-
Notifications
You must be signed in to change notification settings - Fork 844
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
First websocket message dropped #345
Comments
Thank you for reporting this @brimworks |
Thanks Brian, we've reproduced this and we're working on a fix. Internal ticket is TUN-4168. |
This is caused by gorilla/websocket#679 |
After more discussion with gorilla/websocket devs, it looks like cloudflared misuses |
… client instead of gorilla/websocket; move websocket client code into carrier package since it's only used by access subcommands now (#345).
Hi! Release 2021.4.0 should fix this (see commit) @brimworks could you please upgrade your cloudflared and tell us if the issue is fixed? |
Hi @adamchalmers , I've been noticing the websocket connects are getting prematurely closed. It may be an issue in our end (need to investigate further), but that seems to be the only concern at this point. |
We have been trying to use
cloudflared
to expose anats-server
websocket port. However, we are seeing an issue with the first websocket message getting dropped. Note that the first message is sent from thenats-server
to the client and always begins with the word "INFO ".I've found that this issue can be reproduce pretty reliably if you have access to two computers.
[1] ssh to a remote computer and run these commands to download a configuration and server:
You may need to update the second download URL so it matches your hardware. You can view the different nats-server releases here:
https://github.com/nats-io/nats-server/releases/tag/v2.2.0
[2] Run the nats server with this configuration as such:
[3] (optional) port-forward the remote server's port to localhost:
[4] Run cloudflared so it proxies to your nats server running on the remote machine. For example:
[5] Use websocat to test (https://github.com/vi/websocat/releases/tag/v2.0.0-alpha0) ... or you can use Chrome developer tools in order to start a connection with the hostname used by cloudflared:
If successful, the "INFO " message should be printed from the server immediately. If this bug is reproduced, then the "INFO " message is NOT printed and instead the 10 second timeout occurs and the "-ERR 'Authentication Timeout'" is printed (this authentication will always happen after 10 seconds regardless of if the "INFO " message is printed).
Note that this issue is not reliably reproduced, so it may take ~12 times before you can reproduce the issue. As mentioned above, it seems to be more reliable if the network latency between
nats-server
andcloudflared
is higher.The text was updated successfully, but these errors were encountered: