mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Add extra headers param to mg_ws_upgrade()
This commit is contained in:
1 parent
72d3a49352
commit
ae6fd6aa35
8 files changed
+49
-28
No files matched your search
@@ -21,7 +21,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
if (mg_http_match_uri(hm, "/websocket")) {
|
||||
// Upgrade to websocket. From now on, a connection is a full-duplex
|
||||
// Websocket connection, which will receive MG_EV_WS_MSG events.
|
||||
mg_ws_upgrade(c, hm);
|
||||
mg_ws_upgrade(c, hm, NULL);
|
||||
} else if (mg_http_match_uri(hm, "/rest")) {
|
||||
// Serve REST response
|
||||
mg_http_reply(c, 200, "", "{\"result\": %d}\n", 123);
|
||||
|
||||
Reference in new issue
Block a user