set EIO to version 4 in SocketIO examples

see #682
This commit is contained in:
Links
2021-06-17 19:42:09 +02:00
parent a14b6b73b4
commit 72aae52655
2 changed files with 9 additions and 9 deletions

View File

@ -88,7 +88,7 @@ void setup() {
USE_SERIAL.printf("[SETUP] WiFi Connected %s\n", ip.c_str());
// server address, port and URL
socketIO.begin("10.11.100.100", 8880);
socketIO.begin("10.11.100.100", 8880, "/socket.io/?EIO=4");
// event handler
socketIO.onEvent(socketIOEvent);
@ -106,7 +106,7 @@ void loop() {
// creat JSON message for Socket.IO (event)
DynamicJsonDocument doc(1024);
JsonArray array = doc.to<JsonArray>();
// add evnet name
// Hint: socket.on('event_name', ....
array.add("event_name");
@ -119,7 +119,7 @@ void loop() {
String output;
serializeJson(doc, output);
// Send event
// Send event
socketIO.sendEVENT(output);
// Print JSON for debugging