Hello to all, I'm trying to switch from a self hosted Socket.IO server (on Node app on Azure ACA) to Azure Web PubSub for Socket.IO.
I'm facing problems to connect my Arduino devices to the server: I always get an HTTP error 400 (the log message is RX:HTTP/1.1 400 Bad Request).
The connection worked fine on the hosted server.
As always, I'm using the code:
socketIO.begin("xxx.webpubsub.azure.com", 443, "/clients/socketio/hubs/hhh");
socketIO.onEvent(eventHandler);
and I tried also the follow code, but no way:
String path = "/clients/socketio/hubs/hhh/?EIO=4";
wsClient->setExtraHeaders("Connection:Upgrade");
wsClient->setExtraHeaders("Upgrade:websocket");
wsClient->setExtraHeaders("Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits");
wsClient->setExtraHeaders(("hear-auth:" + accessToken).c_str());
// try ever 1000 again if connection has failed
wsClient->setReconnectInterval(500);
// event handler
wsClient->onEvent(this->webSocketEvent);
Serial.println("Socket.io host is: '" + socketServerUrl + "', path is: " + path);
wsClient->begin(socketServerUrl.c_str(), 443, path.c_str());
Do you have some suggestions? Thanks !!