mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a3cfc9858 | ||
|
|
b9b20c6494 | ||
|
|
a8a7d2cf7e | ||
|
|
50ecc30b4d | ||
|
|
cd89db5c2f | ||
|
|
1ed99999bd | ||
|
|
4afebdcb2b | ||
|
|
c3d9d17e34 | ||
|
|
7bf5144e62 | ||
|
|
3eb4eb8074 | ||
|
|
ab000c684a | ||
|
|
aba60dadec | ||
|
|
f29457e967 | ||
|
|
8742fac5d8 | ||
|
|
0ab1c7ef76 | ||
|
|
47abc641f1 | ||
|
|
7519b2ef3a | ||
|
|
ce8657f12f | ||
|
|
8e366916d5 | ||
|
|
33f53ab000 | ||
|
|
bd15ad4301 | ||
|
|
e5b3b8ad32 | ||
|
|
e116c48bef | ||
|
|
7d7bb3b388 | ||
|
|
0b4bf13335 | ||
|
|
228984a3fc | ||
|
|
f084ad8008 | ||
|
|
255da78bed | ||
|
|
5d5badfcee | ||
|
|
4cf9f99ae9 | ||
|
|
673f25f75a | ||
|
|
961fb96bb7 | ||
|
|
d6475fcd19 | ||
|
|
ac538f755f | ||
|
|
5b2eb4f0e1 | ||
|
|
10c274c774 | ||
|
|
eb3b81297d | ||
|
|
80f4133bbf | ||
|
|
d10fb9451c | ||
|
|
88ae2ecadb | ||
|
|
85d19dad47 | ||
|
|
c5cc414181 | ||
|
|
17703fe3e8 | ||
|
|
04aeeba2fa | ||
|
|
4e11d5cdbf | ||
|
|
be63c0dc89 | ||
|
|
987bc1d580 | ||
|
|
ddd35c0cba | ||
|
|
c97b615785 | ||
|
|
9ab6d084df | ||
|
|
cf8d0a25aa | ||
|
|
0a0852b576 | ||
|
|
90716417c9 | ||
|
|
101afbc9b8 | ||
|
|
a197646867 | ||
|
|
00d1d2c0e7 | ||
|
|
6e50fe4475 | ||
|
|
7942803a75 | ||
|
|
a8b74a9021 | ||
|
|
27a9a62843 | ||
|
|
9b268b6c77 | ||
|
|
3b3ac48edd | ||
|
|
598e96a0cc | ||
|
|
b5dd0e8093 | ||
|
|
9b24fdfd1d | ||
|
|
8313896a85 | ||
|
|
8193302162 | ||
|
|
6e3e5560d0 | ||
|
|
f0c6630a16 | ||
|
|
1db747da29 | ||
|
|
8065439f96 | ||
|
|
62c896a872 | ||
|
|
2db07dfc3b | ||
|
|
34eb3f1e66 | ||
|
|
9d30e892e9 | ||
|
|
0aaba7a461 | ||
|
|
3d6b568c6e | ||
|
|
2b2816cfe4 | ||
|
|
2fa18b47db | ||
|
|
c8af7cdd27 | ||
|
|
f857f6394f | ||
|
|
97d733e129 | ||
|
|
77e44c7c0e | ||
|
|
abf89d32d9 | ||
|
|
177e05deb2 | ||
|
|
eb5645241c | ||
|
|
202300952c | ||
|
|
c7bea65ae7 | ||
|
|
d5a9000d46 | ||
|
|
f62018451f | ||
|
|
0a93e301c9 | ||
|
|
6fe9cae62a | ||
|
|
38e984a008 | ||
|
|
09e4254718 | ||
|
|
d4b55c4ceb | ||
|
|
7d5479985d | ||
|
|
6517af3dea | ||
|
|
7632a5e4af | ||
|
|
7f20c41dd5 | ||
|
|
66b23b11b0 | ||
|
|
448b44094a | ||
|
|
8bbb44f90c | ||
|
|
0fba87c755 | ||
|
|
fea648496c | ||
|
|
944a6b761c | ||
|
|
f1ae183752 | ||
|
|
a0ece4e969 | ||
|
|
0bb14abbdd | ||
|
|
4c37e49274 | ||
|
|
2a2bc33a89 | ||
|
|
41558bbf64 | ||
|
|
4d0cc95ff4 | ||
|
|
cfd28a4f7a | ||
|
|
5a0b6fc35a | ||
|
|
3e59e1c465 | ||
|
|
ae611a6e55 | ||
|
|
a7a2e3deb1 | ||
|
|
cae0a1cbc0 | ||
|
|
244e5f67d3 | ||
|
|
ff078882d5 | ||
|
|
8d76733fad | ||
|
|
fb3a5a7d90 | ||
|
|
f374ac5f9a | ||
|
|
02707364f0 | ||
|
|
104106b9cf | ||
|
|
474e065a30 | ||
|
|
27094896b1 | ||
|
|
cd48bcfd7d | ||
|
|
5baeba53d7 | ||
|
|
3a3b433849 | ||
|
|
a2192ae483 | ||
|
|
023b55f2e5 | ||
|
|
e4309d472b | ||
|
|
c5452fc2ec | ||
|
|
f78ee9d42e | ||
|
|
c8416cc17d | ||
|
|
cf0a969a65 | ||
|
|
06670d3401 | ||
|
|
7c0493071f | ||
|
|
c60fe0c6f6 |
No files matched your search
@@ -8,7 +8,7 @@ used by vast number of open source and
|
||||
commercial products - it even runs on the International Space station!
|
||||
Mongoose makes embedded network programming fast, robust, and easy.
|
||||
|
||||
- [Download Mongoose Source Code here](https://www.cesanta.com)
|
||||
- [Download Mongoose Source Code here](https://www.cesanta.com/download.html)
|
||||
|
||||
Looking for a complete IoT firmware solution?
|
||||
|
||||
@@ -16,10 +16,10 @@ Check out [Mongoose OS](https://mongoose-os.com) - open source embedded operatin
|
||||
|
||||
# Support
|
||||
- [Study mongoose example code](https://github.com/cesanta/mongoose/tree/master/examples)
|
||||
- [Read User Guide and API reference](https://docs.cesanta.com/mongoose)
|
||||
- [Support Forum - ask your technical questions here] (http://forum.cesanta.com/index.php?p=/categories/mongoose)
|
||||
- [Commercial licensing and support available] (https://www.cesanta.com/services-support)
|
||||
- [Check our latest releases] (https://github.com/cesanta/mongoose/releases)
|
||||
- [Read User Guide and API reference](https://cesanta.com/docs/overview/intro.html)
|
||||
- [Support Forum - ask your technical questions here](https://forum.mongoose-os.com/categories/mongoose)
|
||||
- [Commercial licensing and support available](https://www.cesanta.com/licensing.html)
|
||||
- [Check our latest releases](https://github.com/cesanta/mongoose/releases)
|
||||
|
||||
# Features
|
||||
|
||||
@@ -47,7 +47,7 @@ Check out [Mongoose OS](https://mongoose-os.com) - open source embedded operatin
|
||||
|
||||
Mongoose is released under Commercial and [GNU GPL v.2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) open source licenses.
|
||||
|
||||
Commercial Projects: [Contact us for commercial license.] (https://www.cesanta.com/contact)
|
||||
Commercial Projects: [Contact us for commercial license.](https://www.cesanta.com/contact.html)
|
||||
|
||||
# Dashboard Example
|
||||
|
||||
@@ -55,18 +55,14 @@ Mongoose is often used to implement device dashboards and real-time
|
||||
data exchange over Websocket. Here is a dashboard example that illustrates
|
||||
the functionality:
|
||||
|
||||

|
||||

|
||||
|
||||
[Developing a new product? Contact us today to discuss how Mongoose can help.
|
||||
](https://www.cesanta.com/contact)
|
||||
[Developing a new product? Contact us today to discuss how Mongoose can help.](https://www.cesanta.com/contact.html)
|
||||
|
||||
# Contributions
|
||||
|
||||
To submit contributions, sign
|
||||
[Cesanta CLA](https://docs.cesanta.com/contributors_la.shtml)
|
||||
To submit contributions, sign [Cesanta CLA](https://cesanta.com/cla.html)
|
||||
and send GitHub pull request. You retain the copyright on your contributions.
|
||||
|
||||
# Looking for a pre-compiled Mongoose web server Windows or Mac binary?
|
||||
- [Download pre-compiled Mongoose web server binary.](https://www.cesanta.com/products/binary)
|
||||
|
||||
[](https://github.com/cesanta/mongoose)
|
||||
- [Download pre-compiled Mongoose web server binary.](https://www.cesanta.com/binary.html)
|
||||
@@ -1,23 +0,0 @@
|
||||
---
|
||||
title: "mg_http_parse_header()"
|
||||
decl_name: "mg_http_parse_header"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf,
|
||||
size_t buf_size);
|
||||
---
|
||||
|
||||
Parses the HTTP header `hdr`. Finds variable `var_name` and stores its value
|
||||
in the buffer `buf`, `buf_size`. Returns 0 if variable not found, non-zero
|
||||
otherwise.
|
||||
|
||||
This function is supposed to parse cookies, authentication headers, etc.
|
||||
Example (error handling omitted):
|
||||
|
||||
char user[20];
|
||||
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
|
||||
mg_http_parse_header(hdr, "username", user, sizeof(user));
|
||||
|
||||
Returns the length of the variable's value. If buffer is not large enough,
|
||||
or variable not found, 0 is returned.
|
||||
|
||||
+12
-12
@@ -1,16 +1,16 @@
|
||||
---
|
||||
items:
|
||||
- { name: mbuf.h }
|
||||
- { name: net.h }
|
||||
- { name: http.h }
|
||||
- { name: http_server.h }
|
||||
- { name: http_client.h }
|
||||
- { name: dns.h }
|
||||
- { name: dns_server.h }
|
||||
- { name: resolv.h }
|
||||
- { name: mqtt.h }
|
||||
- { name: mqtt_server.h }
|
||||
- { name: coap.h }
|
||||
- { name: util.h }
|
||||
- { name: uri.h }
|
||||
- { name: mg_net.h }
|
||||
- { name: mg_http.h }
|
||||
- { name: mg_http_server.h }
|
||||
- { name: mg_http_client.h }
|
||||
- { name: mg_dns.h }
|
||||
- { name: mg_dns_server.h }
|
||||
- { name: mg_resolv.h }
|
||||
- { name: mg_mqtt.h }
|
||||
- { name: mg_mqtt_server.h }
|
||||
- { name: mg_coap.h }
|
||||
- { name: mg_util.h }
|
||||
- { name: mg_uri.h }
|
||||
---
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "CoAP API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "coap.h"
|
||||
decl_name: "mg_coap.h"
|
||||
items:
|
||||
- { name: mg_coap_add_option.md }
|
||||
- { name: mg_coap_compose.md }
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "DNS API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "dns.h"
|
||||
decl_name: "mg_dns.h"
|
||||
items:
|
||||
- { name: mg_dns_copy_questions.md }
|
||||
- { name: mg_dns_encode_name.md }
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "DNS server API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "dns_server.h"
|
||||
decl_name: "mg_dns_server.h"
|
||||
items:
|
||||
- { name: mg_dns_create_reply.md }
|
||||
- { name: mg_dns_reply_record.md }
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,10 +1,12 @@
|
||||
---
|
||||
title: "Common API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "http.h"
|
||||
decl_name: "mg_http.h"
|
||||
items:
|
||||
- { name: mg_connect_ws.md }
|
||||
- { name: mg_connect_ws_opt.md }
|
||||
- { name: mg_http_is_authorized.md }
|
||||
- { name: mg_http_send_digest_auth_request.md }
|
||||
- { name: mg_printf_websocket_frame.md }
|
||||
- { name: mg_send_websocket_frame.md }
|
||||
- { name: mg_send_websocket_framev.md }
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "mg_http_is_authorized()"
|
||||
decl_name: "mg_http_is_authorized"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_http_is_authorized(struct http_message *hm, struct mg_str path,
|
||||
const char *domain, const char *passwords_file,
|
||||
int flags);
|
||||
---
|
||||
|
||||
Checks whether an http request is authorized. `domain` is the authentication
|
||||
realm, `passwords_file` is a htdigest file (can be created e.g. with
|
||||
`htdigest` utility). If either `domain` or `passwords_file` is NULL, this
|
||||
function always returns 1; otherwise checks the authentication in the
|
||||
http request and returns 1 only if there is a match; 0 otherwise.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: "mg_http_send_digest_auth_request()"
|
||||
decl_name: "mg_http_send_digest_auth_request"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
void mg_http_send_digest_auth_request(struct mg_connection *c,
|
||||
const char *domain);
|
||||
---
|
||||
|
||||
Sends 401 Unauthorized response.
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+2
-4
@@ -7,8 +7,6 @@ signature: |
|
||||
const struct mg_str *strings, int num_strings);
|
||||
---
|
||||
|
||||
Sends multiple websocket frames.
|
||||
|
||||
Like `mg_send_websocket_frame()`, but composes a frame from multiple
|
||||
*buffers.
|
||||
Like `mg_send_websocket_frame()`, but composes a single frame from multiple
|
||||
buffers.
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Client API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "http_client.h"
|
||||
decl_name: "mg_http_client.h"
|
||||
items:
|
||||
- { name: mg_connect_http.md }
|
||||
- { name: mg_connect_http_opt.md }
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -6,7 +6,7 @@ signature: |
|
||||
int mg_http_create_digest_auth_header(char *buf, size_t buf_len,
|
||||
const char *method, const char *uri,
|
||||
const char *auth_domain, const char *user,
|
||||
const char *passwd);
|
||||
const char *passwd, const char *nonce);
|
||||
---
|
||||
|
||||
Creates digest authentication header for a client request.
|
||||
@@ -1,14 +1,16 @@
|
||||
---
|
||||
title: "Server API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "http_server.h"
|
||||
decl_name: "mg_http_server.h"
|
||||
items:
|
||||
- { name: mg_check_digest_auth.md }
|
||||
- { name: mg_file_upload_handler.md }
|
||||
- { name: mg_get_http_basic_auth.md }
|
||||
- { name: mg_get_http_header.md }
|
||||
- { name: mg_get_http_var.md }
|
||||
- { name: mg_http_check_digest_auth.md }
|
||||
- { name: mg_http_parse_header.md }
|
||||
- { name: mg_http_parse_header2.md }
|
||||
- { name: mg_http_reverse_proxy.md }
|
||||
- { name: mg_http_send_error.md }
|
||||
- { name: mg_http_send_redirect.md }
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "mg_check_digest_auth()"
|
||||
decl_name: "mg_check_digest_auth"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_check_digest_auth(struct mg_str method, struct mg_str uri,
|
||||
struct mg_str username, struct mg_str cnonce,
|
||||
struct mg_str response, struct mg_str qop,
|
||||
struct mg_str nc, struct mg_str nonce,
|
||||
struct mg_str auth_domain, FILE *fp);
|
||||
---
|
||||
|
||||
Authenticates given response params against an opened password file.
|
||||
Returns 1 if authenticated, 0 otherwise.
|
||||
|
||||
It's used by mg_http_check_digest_auth().
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "mg_http_parse_header()"
|
||||
decl_name: "mg_http_parse_header"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf,
|
||||
size_t buf_size);
|
||||
---
|
||||
|
||||
DEPRECATED: use mg_http_parse_header2() instead.
|
||||
|
||||
Same as mg_http_parse_header2(), but takes buffer as a `char *` (instead of
|
||||
`char **`), and thus it cannot allocate a new buffer if the provided one
|
||||
is not enough, and just returns 0 in that case.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: "mg_http_parse_header2()"
|
||||
decl_name: "mg_http_parse_header2"
|
||||
symbol_kind: "func"
|
||||
signature: |
|
||||
int mg_http_parse_header2(struct mg_str *hdr, const char *var_name, char **buf,
|
||||
size_t buf_size);
|
||||
---
|
||||
|
||||
Parses the HTTP header `hdr`. Finds variable `var_name` and stores its value
|
||||
in the buffer `*buf`, `buf_size`. If the buffer size is not enough,
|
||||
allocates a buffer of required size and writes it to `*buf`, similar to
|
||||
asprintf(). The caller should always check whether the buffer was updated,
|
||||
and free it if so.
|
||||
|
||||
This function is supposed to parse cookies, authentication headers, etc.
|
||||
Example (error handling omitted):
|
||||
|
||||
char user_buf[20];
|
||||
char *user = user_buf;
|
||||
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
|
||||
mg_http_parse_header2(hdr, "username", &user, sizeof(user_buf));
|
||||
// ... do something useful with user
|
||||
if (user != user_buf) {
|
||||
free(user);
|
||||
}
|
||||
|
||||
Returns the length of the variable's value. If variable is not found, 0 is
|
||||
returned.
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "MQTT API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mqtt.h"
|
||||
decl_name: "mg_mqtt.h"
|
||||
items:
|
||||
- { name: mg_mqtt_connack.md }
|
||||
- { name: mg_mqtt_disconnect.md }
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
@@ -5,6 +5,7 @@ symbol_kind: "struct"
|
||||
signature: |
|
||||
struct mg_mqtt_proto_data {
|
||||
uint16_t keep_alive;
|
||||
double last_control_time;
|
||||
};
|
||||
---
|
||||
|
||||
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "MQTT Server API reference"
|
||||
symbol_kind: "intro"
|
||||
decl_name: "mqtt_server.h"
|
||||
decl_name: "mg_mqtt_server.h"
|
||||
items:
|
||||
- { name: LIST_ENTRY.md }
|
||||
- { name: struct_mg_mqtt_broker.md }
|
||||
File renamed without changes.
Loaded 100 of 447 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user