diff --git a/mongoose.c b/mongoose.c index 01d4d64d83333c419b87f20af4d0d82dca4e63cf..eadb05b6224c321c9cf8dda5cd05f739143e9417 100644 --- a/mongoose.c +++ b/mongoose.c @@ -2734,6 +2734,7 @@ static void send_websocket_handshake_if_requested(struct mg_connection *conn) { if (call_user(MG_CONN_2_CONN(conn), MG_WS_HANDSHAKE) == MG_FALSE) { send_websocket_handshake(conn, key); } + call_user(MG_CONN_2_CONN(conn), MG_WS_CONNECT); } } diff --git a/mongoose.h b/mongoose.h index 5f879a9e21bbd90069f94081235e1f95338cb8df..760ae06e98576feadc04b62a6fb5b0cbec84772f 100644 --- a/mongoose.h +++ b/mongoose.h @@ -68,6 +68,7 @@ enum mg_event { MG_REPLY, // If callback returns MG_FALSE, Mongoose closes connection MG_CLOSE, // Connection is closed, callback return value is ignored MG_WS_HANDSHAKE, // New websocket connection, handshake request + MG_WS_CONNECT, // New websocket connection established MG_HTTP_ERROR // If callback returns MG_FALSE, Mongoose continues with err }; typedef int (*mg_handler_t)(struct mg_connection *, enum mg_event);