File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -402,8 +402,11 @@ void WebSocketsServer::handleHeader(WSclient_t * client) {
402
402
if (headerLine.startsWith (" GET " )) {
403
403
// cut URL out
404
404
client->cUrl = headerLine.substring (4 , headerLine.indexOf (' ' , 4 ));
405
- } else if (headerLine == " Connection: Upgrade" ) {
406
- client->cIsUpgrade = true ;
405
+ } else if (headerLine.startsWith (" Connection: " )) {
406
+ // 12 = lenght of "Connection: "
407
+ if (headerLine.indexOf (" Upgrade" , 12 )) {
408
+ client->cIsUpgrade = true ;
409
+ }
407
410
} else if (headerLine.startsWith (" Upgrade: " )) {
408
411
// 9 = lenght of "Upgrade: "
409
412
String low = headerLine.substring (9 );
Original file line number Diff line number Diff line change 2
2
< head >
3
3
4
4
< script >
5
- var connection = new WebSocket ( 'ws://10.11.2.1 :81/test' , [ 'arduino' ] ) ;
5
+ var connection = new WebSocket ( 'ws://10.11.2.2 :81/test' , [ 'arduino' ] ) ;
6
6
7
7
connection . onopen = function ( ) {
8
8
connection . send ( 'Message from Browser to ESP8266 yay its Working!! ' + new Date ( ) ) ;
You can’t perform that action at this time.
0 commit comments