I try to solve this for too long, so I need your help.
I have a websocket server on Azure, it's working fine on external websocket connection like http://www.websocket.org/echo.html when I put the page address, It connect and return reply.
On the Arduino, when I try to connect to the demo: ws://echo.websocket.org it works find.
but when I connect the Arduino to my web page, It just doesn't connect.
I think It even stoped at he ethernet client.connect commmand.
this is the full command:
client.connect("ws://webapplication66533.azurewebsites.net/echohandler.ashx", 80) ;
again, this is working fine in my Arduino code:
client.connect("ws://echo.websocket.org", 80) ;
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println(F("Demo example on Dror WebSocket usage"));
Ethernet.begin(mac); // initialize ethernet
delay(1000);
Serial.println(Ethernet.localIP()); // printout IP address for debug purposes
delay(1000);
// if (client.connect("ws://echo.websocket.org", 80)) { ----> this is working
if (client.connect("ws://webapplication66533.azurewebsites.net/echohandler.ashx", 80)) { // <----- it stops here
Serial.println("connected");
}
else {
Serial.println("connection failed");
while (1) ;
}
// Define path and host for Handshaking with the server
websocket.path = "/"; //websocket.host = "echo.websocket.org"; ----> this is working
websocket.host = "webapplication66533.azurewebsites.net/echohandler.ashx";
while (!websocket.handshake(client)) {
Serial.println("Handshake failed.");
delay(1000);
}
Serial.println("Handshake successful");
After hour and hours of working on this. I got to this conclusion and I want to ask you if I'm right:
The reason that Arduino cannot connect to my server is because my Azure server runs on .net 4.5.
Is there a reason that arduino cannot support this "new" web socket method ?
Is there anything I can change in the connection from the WebSocketClient.cpp that can support this ?