esp8266-websocketclient icon indicating copy to clipboard operation
esp8266-websocketclient copied to clipboard

No connect with server.....

Open Cosmat opened this issue 6 years ago • 6 comments

The code in this example does not even connect to echo.websocket.org. The compiler does not produce any errors. Esp connects to my Wi-Fi but does not connect to the server. Neither with my example server written on a node or with an echo-server from your exemple. Please, help)...

Cosmat avatar Aug 12 '19 13:08 Cosmat

Similarly with my device. Esp connects to Wi-Fi but does not connect to the server.

HiveBeats avatar Nov 24 '19 05:11 HiveBeats

same thing happened with me, my device also did't connect to the server i also tried to connect with my server written in node.js but did't work

sachinbaghel14 avatar Apr 21 '20 09:04 sachinbaghel14

same thing happened with me, my device also did't connect to the server i also tried to connect with my server written in node.js but did't work

I recommend you using https://github.com/gilmaimon/ArduinoWebsockets, i tested webclient example. It works flawlessly

keremcc avatar Apr 21 '20 10:04 keremcc

I tested your code in local server and It worked. Let me tell you what I changed. 1- in client side your port is 8080, in node.js side is 8081, they have to be same. 2- I changed this line bool connected = client.connect(websockets_server_host); 3- const char* websockets_server_host = "http://localhost:5000"; I added port embedded to link So this is my test, you can adapt it to yourself.

keremcc avatar Apr 21 '20 11:04 keremcc

The code work if not use WiFiClientSecure, if set WebSocketClient ws(false) and port 80, no problem. But in mode secure with port 443, not work.

fernando-rodrigues-dev avatar May 11 '21 20:05 fernando-rodrigues-dev

Yea - any guidance on wss:// ? I'm attempting to hit a wss://blah.co:8080 but all I get is Not Connected!

Using WebSocketClient ws(true);

ws.connect("blah.co", "/", 8080);

Also I've tested this WS independently and it works so can't seem gather what the issue is.

cleathersden avatar Aug 30 '21 03:08 cleathersden