require-specific-test-protocol.patch
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
ce510c6beb
commit
462bbf711e
2 changed files with 9 additions and 5 deletions
|
@ -164,12 +164,16 @@ static int websocket_callback(struct libwebsocket * wsi,
|
|||
case LWS_CALLBACK_PROTOCOL_FILTER:
|
||||
if (in == NULL) {
|
||||
fprintf(stderr, "Client did not request protocol\n");
|
||||
/* accept it */
|
||||
return 0;
|
||||
/* reject it */
|
||||
return 1;
|
||||
}
|
||||
fprintf(stderr, "Client requested protocol '%s'\n", in);
|
||||
/* accept it */
|
||||
return 0;
|
||||
if (strcmp(in, "dumb-increment-protocol") == 0)
|
||||
/* accept it */
|
||||
return 0;
|
||||
|
||||
/* reject the connection */
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
else
|
||||
websocket_ads = "ws://127.0.0.1:7681"
|
||||
|
||||
var socket = new WebSocket(websocket_ads);
|
||||
var socket = new WebSocket(websocket_ads, "dumb-increment-protocol");
|
||||
|
||||
try {
|
||||
// alert('<p class="event">Socket Status: '+socket.readyState);
|
||||
|
|
Loading…
Add table
Reference in a new issue