gilmaimon / ArduinoWebsockets

A library for writing modern websockets applications with Arduino (ESP8266 and ESP32)
GNU General Public License v3.0
463 stars 98 forks source link

Getting my connection closed when on node js wss server #163

Open dederomagnolo opened 2 months ago

dederomagnolo commented 2 months ago

Hi all and @gilmaimon. First of all, thanks for this lib and for all the support for the community. This is very useful and I could learn A LOT about websockets reading the discussions here.

Describe the bug I have a problem on my system with node js wss server + esp8266 clients.

my clients enter in a kind of loop when the server is authenticating them and immediately the connection is closed. I can see the close event only on client side and it is returning 1002 (protocols errors).

Technical settings:

sencin commented 2 months ago

hello may i ask what format of websocket did you use in render? in local my websocket in working but on render, i cant seem to connect my nodejs server

dederomagnolo commented 2 months ago

Hey @Sencin, you can share the error you getting, more easy to debug. The only thing I remember, in the beggining I had connection problems cause I tried to connect to the host using ws:// instead of wss://. Render interprets it as an insecure connection.

sencin commented 2 months ago

Does it need a SSL since it's a secure connection. Or does render already have SSL for Web sockets?

dederomagnolo commented 2 months ago

I think they already have. Not clear for me too, but take a look on this thread on their community: https://community.render.com/t/connect-via-websockets/8355/3

and share if you get any success.