mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-13 15:26:31 +02:00
@ -402,8 +402,11 @@ void WebSocketsServer::handleHeader(WSclient_t * client) {
|
|||||||
if(headerLine.startsWith("GET ")) {
|
if(headerLine.startsWith("GET ")) {
|
||||||
// cut URL out
|
// cut URL out
|
||||||
client->cUrl = headerLine.substring(4, headerLine.indexOf(' ', 4));
|
client->cUrl = headerLine.substring(4, headerLine.indexOf(' ', 4));
|
||||||
} else if(headerLine == "Connection: Upgrade") {
|
} else if(headerLine.startsWith("Connection: ")) {
|
||||||
|
// 12 = lenght of "Connection: "
|
||||||
|
if(headerLine.indexOf("Upgrade", 12)) {
|
||||||
client->cIsUpgrade = true;
|
client->cIsUpgrade = true;
|
||||||
|
}
|
||||||
} else if(headerLine.startsWith("Upgrade: ")) {
|
} else if(headerLine.startsWith("Upgrade: ")) {
|
||||||
// 9 = lenght of "Upgrade: "
|
// 9 = lenght of "Upgrade: "
|
||||||
String low = headerLine.substring(9);
|
String low = headerLine.substring(9);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var connection = new WebSocket('ws://10.11.2.1:81/test', ['arduino']);
|
var connection = new WebSocket('ws://10.11.2.2:81/test', ['arduino']);
|
||||||
|
|
||||||
connection.onopen = function () {
|
connection.onopen = function () {
|
||||||
connection.send('Message from Browser to ESP8266 yay its Working!! ' + new Date());
|
connection.send('Message from Browser to ESP8266 yay its Working!! ' + new Date());
|
||||||
|
Reference in New Issue
Block a user