Skip to content
Snippets Groups Projects
Commit 6e3e5560 authored by Бобби's avatar Бобби Committed by Cesanta Bot
Browse files

Move mongoose docs to https://cesanta.com/docs/

PUBLISHED_FROM=ebf5568abe82952ab2751298185a10189098013f
parent f0c6630a
No related branches found
No related tags found
No related merge requests found
Showing
with 31 additions and 92 deletions
File moved
---
title: CoAP
items:
- { name: server_example.md }
- { name: client_example.md }
- { name: ../c-api/coap.h/ }
---
File moved
---
title: DNS client example
---
See https://github.com/cesanta/mongoose/blob/master/mongoose.c and search
for the `mg_resolve_async_eh()` function - that is the core of
built-in Mongoose async DNS resolver.
---
title: DNS server example
---
# Examples
## DNS server example
To create a DNS server, follow this pattern:
......@@ -71,3 +72,10 @@ int main(int argc, char *argv[]) {
```
See full [Captive DNS server example](https://github.com/cesanta/mongoose/tree/master/examples/captive_dns_server).
## DNS client example
See https://github.com/cesanta/mongoose/blob/master/mongoose.c and search
for the `mg_resolve_async_eh()` function - that is the core of
built-in Mongoose async DNS resolver.
---
title: DNS
items:
- { name: server_example.md }
- { name: client_example.md }
- { name: ../c-api/dns.h/ }
- { name: ../c-api/dns_server.h/ }
---
---
title: CGI
---
# CGI
[CGI](https://en.wikipedia.org/wiki/Common_Gateway_Interface)
is a simple mechanism to generate dynamic content.
......@@ -32,4 +30,4 @@ Example:
NOTE: In the CGI handler we don't use explicitly a system call waitpid() for
reaping zombie processes. Instead, we set the SIGCHLD handler to SIG_IGN.
It will cause zombie processes to be reaped automatically.
CAUTION: not all OSes (e.g. QNX) reap zombies if SIGCHLD is ignored.
\ No newline at end of file
CAUTION: not all OSes (e.g. QNX) reap zombies if SIGCHLD is ignored.
---
title: HTTP client example
---
# HTTP client example
To create an HTTP client, follow this pattern:
......
---
title: Digest Authentication
---
# Digest Authentication
Mongoose has a built-in Digest (MD5) authentication support. In order to
enable Digest authentication, create a file `.htpasswd` in the directory
......@@ -8,7 +6,7 @@ you would like to protect. That file should be in the format that Apache's
`htdigest` utility.
You can use either Apache `htdigest` utility, or
Mongoose pre-build binary (https://www.cesanta.com/products/binary)
Mongoose pre-build binary at https://www.cesanta.com/binary.html
to add new users into that file:
```
......
---
title: HTTP events
---
#: HTTP events
As discussed in the overview, `mg_set_protocol_http_websocket()` function
parses incoming data, treats it as HTTP or WebSocket, and triggers high-level
......
---
title: Serving files
---
# Serving files
API function `mg_serve_http()` makes it easy to serve files from a filesystem.
Generally speaking, that function is an implementation of the HTTP server
......
---
title: HTTP
items:
- { name: server_example.md }
- { name: client_example.md }
- { name: events.md }
- { name: files.md }
- { name: cgi.md }
- { name: ssi.md }
- { name: upload.md }
- { name: ssl.md }
- { name: digest_auth.md }
- { name: ../c-api/http.h/ }
- { name: ../c-api/http_server.h/ }
- { name: ../c-api/http_client.h/ }
---
---
title: HTTP server example
---
# HTTP server example
To create an HTTP server, follow this pattern:
......
---
title: SSI
---
# SSI
Server Side Includes (SSI) is a simple interpreted server-side scripting
language which is most commonly used to include the contents of a file
......
---
title: Enabling HTTPS
---
# Enabling SSL (HTTPS)
To enable SSL on the server side, please follow these steps:
......
---
title: Handling file uploads
---
# Handling file uploads
In order to handle file uploads, use the following HTML snippet:
```HTML
<form method="POST" action="/upload" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
<form method="POST" action="/upload" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
```
Uploaded files will be sent to the `/upload` endpoint via the `POST` request.
......
---
title: MQTT client example
---
See https://github.com/cesanta/mongoose/tree/master/examples/mqtt_client
# Examples
- [Client example](https://github.com/cesanta/mongoose/tree/master/examples/mqtt_client)
- [Server example](https://github.com/cesanta/mongoose/tree/master/examples/mqtt_broker)
---
title: MQTT
items:
- { name: server_example.md }
- { name: client_example.md }
- { name: ../c-api/mqtt.h/ }
- { name: ../c-api/mqtt_server.h/ }
---
---
title: MQTT server example
---
See https://github.com/cesanta/mongoose/tree/master/examples/mqtt_broker
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment