Arduino doesn't connect to my Azure websocket

Hi All,

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) ;

What am I doing wrong ??

What am I doing wrong ??

Since you failed to post your code, I'm going to guess "everything".

You are right....
It's now not working on Handshake failed...

#include <Ethernet.h>
#include <SPI.h>
#include <WebSocketClient.h>

EthernetClient client;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
WebSocketClient websocket;

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 adding these lines :
if (client.connected()) {
Serial.println(F("it is connected"));
}
else {
Serial.println(F("client is not connected"));
}

I get "client is not connected"

So I think it just doesn't connect right, I just don't know why....

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 ?

What do you think ?

Dror