dpallot / simple-websocket-server

A python based websocket server that is simple and easy to use.
950 stars 320 forks source link

Send an error on handshake failure #81

Closed uzlonewolf closed 5 years ago

uzlonewolf commented 6 years ago

Return a 426 Upgrade Required response when the handshake fails, i.e. someone went to http://server . We should probably look at the provided headers and be more specific about the error, but this is good enough for now and is enough to cause the error to be logged in the browsers' console/network log.

uzlonewolf commented 6 years ago

I wanted to see what TLS version and ciphers were being negotiated, but Chrome's Security Console wasn't showing the connection as the connection was getting closed without any response. Returning an error like this allows it to show up in the log.