-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"WebSocket protocol error: httparse error: invalid token" when connect from ngrok tcp tunnel. #319
Comments
Sounds like an invalid header line or something. This error originates from the |
I've made a simple tcp server to listen for websocket connections, but the initial message sent to the server seems to be garbled. Here's a request I got on this test TCP server via ngrok:
Could this maybe have something to do with connecting with secure websockets (wss://) over ngrok? |
This certainly depends on the configuration of the ngrok. I think without an additional configuration it would indeed expect non-encrypted traffic. So it depends on which endpoints you're exposing. |
I'm running a tcp tunnel through ngrok without tls (using |
The "Got string" message looks like TLS encryption. Can it be that the client expects unencrypted HTTP headers while the server sends encrypted ones? In this case you would get a httparse error message just like you actually got. How exactly do you connect? |
@Atlinx Any solution to this problem? I am implementing websockets between onion services using the new I seem to bounce between the error you received and "WebSocket protocol error: httparse error: invalid HTTP version". I think @agalakhov is right, the headers are being encrypted as part of the message, which is required because proxies must remove the |
I never figured out how to get ngrok to work, so I ended up using the rathole, which forwards traffic from a cloud server to my location machine. Hope that helps :) |
When I tried using an ngrok tcp tunnel to point towards a tokio-tungstenite websocket server on my localhost, I get an "httparse error: invalid token" error. Does anyone know why this is happening?
The text was updated successfully, but these errors were encountered: