I got invalid socket key warning on the server when trying to hand shake. It's happened sometimes and not all the time.
The server is socket.io over node.js and the client is cocoa-websocket.
Any help about it?
Thanks.
Related
I am getting an error and am trying to get an explanation as to its meaning. Anyone who can shed light on the meaning and the fix would be appreciated.
Firefox can’t establish a connection to the server at wss://myurl.com/socket.io/?EIO=4&transport=websocket&sid=66o3W59fgV4wklBbAAAO.
I'm using Google's simplehttp2server go-lang program to run some tests and have encountered a recurring error. Upon executing the TLS handshake I receive the following error:
2019/12/12 12:42:55 http: TLS handshake error from 127.0.0.1:36202: read tcp 127.0.0.1:5000->127.0.0.1:36202: use of closed network connection
I have updated my go version to 1.13.5 from 1.12.9 and tried two browsers (brave + chrome) plus curl and receive the same error code each time. It happens over HTTP/2 and HTTP/1.1. I have seem other answers from across the web but am still running into this error (ex1, ex2, ex3, ex4).
Very much appreciate any feedback, advice, or admonishment. Anything to help the migraine this problem is giving me!
edit: screenshot from my curl and running of simplehttp2server
example image from curl and simplehttp2server
This error happens when you have two websockets connected to a singular address using the same port from the same machine. One of the websockets will be able to connect fine but the other wont be able to make the connection.
I was making the same mistake and when I removed the duplicate connection the error resolved.
I was trying to connect to a server in Go by using gorilla/websocket
and I kept getting the error "unexpected EOF". It took me way too long to find out it was because I needed to use the secure WebSocket protocol to connect to that server ("wss://" instead of "ws://" in my url).
How can I verify that I'm using the wrong protocol for a given endpoint so that I can log a helpful error message instead of "unexpected EOF"?
I tried to connect to the Push API in poloniex using python and followed the instructions on the answer here:
How to connect to poloniex.com websocket api using a python library
However I keep getting this error:
2017-06-25T04:07:04 dropping connection to peer tcp:104.20.13.48:443 with abort=True: WebSocket opening handshake timeout (peer did not finish the opening handshake in time)
Anyone know what's going on here? I can't figure it out from online documentation. Thanks!
As per #Cyphrags suggestion, I was able to get my autobahn websocket to work outside of localhost by increasing openHandshakeTimeout with factory.setProtocolOptions
factory.protocol = MyClientProtocol
factory.setProtocolOptions(failByDrop=False, openHandshakeTimeout=90, closeHandshakeTimeout=5)
Solution found via https://github.com/crossbario/crossbar/issues/930. Perhaps the reason it is needed has something to do with slow DNS routing taking longer than the default handshake time.
When I'm starting websockify with python2.7 on my server no warnings appear, everything is ok.
But when the first connection comes in there are problems with base64 I think:
1: <ip>: Plain non-SSL (ws://) WebSocket connection
1: <ip>: Version hybi-13, base64: 'False'
1: connecting to: <myserver.com>:64749
On the client side I get an error in safari but it also tells me that the connection is made and I'm able to send and receive messages:
WebSocket network error: The operation couldn’t be completed. Connection refused ws://localhost:17523
The error about connecting to ws://localhost:17523 is harmless. In order to test whether the WebSocket API supports binary data it is necessary to actually instantiate a WebSocket object, however, WebSocket objects must be instantiated with an actual destination so websock.js uses a localhost port to test the connection. The browser complains that the connection fails but websock.js is able to use that object to do its test.
The base64: False indicates that the client and server have negotiated to use raw binary data and don't need to use base64 encoded strings to encode the data. Base64 encoding is necessary in older browsers (or with web-socket-js emulator) that support WebSockets but not binary data.
Since you are successfully sending and receiving data, I assume this question is just verifying that the messages you are seeing aren't major problems correct?