Nice work @JumJum, in my case I've used a longer Sha1 function which I couldn't include in ESP8266 because of its memory limit. So I couldnt test it actually till now.
For the keep alive all what you need is sending the ping message to the clients on interval and also pong pack if the client sent a ping.
In my ws client I found that the server was not sending me any pings and thats why I made the client keep the connections alive by sending ping requests to the server and wait for it's pong.
Is there any difference between net.createServer & http.createServer? I thought it is better to use the net one.
I will try your code when I am back home and will let you know
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Nice work @JumJum, in my case I've used a longer Sha1 function which I couldn't include in ESP8266 because of its memory limit. So I couldnt test it actually till now.
For the keep alive all what you need is sending the ping message to the clients on interval and also pong pack if the client sent a ping.
In my ws client I found that the server was not sending me any pings and thats why I made the client keep the connections alive by sending ping requests to the server and wait for it's pong.
Is there any difference between net.createServer & http.createServer? I thought it is better to use the net one.
I will try your code when I am back home and will let you know