-
Notifications
You must be signed in to change notification settings - Fork 270
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
Can autoreconnect be used with a client connection? #66
Comments
The syntax is Note that in current version of websocat there is no delay or ratelimit of reconnect attempts, which may lead to flood / CPU busy spin. What do you want to attain? Maybe there is another way to do it? Do you use websocat interactively or as part of some script? |
Thank you for the fast reply! I've downloaded the precompiled binary and on Windows 10 here is what I get:
I'd like to use it to send updates to another program, I'd just like it to recovery automatically if there were a wifi disconnect / reconnect. I'm open to any suggestions on that. |
Try
|
worked perfectly - thank you! |
Hi Vitaly, I haven't used Would this work?
If it were added here?: websocat/src/reconnect_peer.rs Lines 99 to 102 in c14a1d3
Even a short delay seems like it would prevent the flood / CPU busy spin. |
I considered adding a delay almost from the very beginning, but at that moment Websocat contained no timers whatsoever, so I postponed it.
Bad idea, as Websocat is single-threaded and polling and stopping entire thread should be avoided. |
Implemented proper timeout, also created a set of pre-compiled executables. |
This is so great! Do you accept donations? |
Is there any update of the syntax? ➜ /tmp websocat autoreconnect:ws://echo.websocket.org
Specify ws:// or wss:// URI to connect to a websocket
websocat: Invalid command-line parameters |
No update on syntax. But samples above weren't right in the first place.
Currently one-positional-argument form of Websocal command line is reserved only for trivial clients and servers without any overlays. The error message may indeed be improved. You may also want to adjust |
@vi Can websocat handle intermittent disconnects without breaking overlayed TCP connections when websocket is used as a proxy? I've checked |
"Unreliable" probably means that with multiple simultaneous clients On the other hand, unlike With
Do you need a reuser in the first place for this? Maybe just plain |
@vi |
Some data loss (hence encrypted connection corruption) is hard to avoid in this scheme. Holding a persistent and reliable connection over abruptly terminating and reconnecting WebSocket connections requires some overarching, persistent sequence numbers and retransmits (i.e. additional parts both at client and server). Maybe you can set up Wireguard VPN over websocat (and then use SSH over that Wireguard connection)? Wireguard handles unreliable connections nicely and will provide slower, but more reliable link to users. If needed, Wireguard protocol can be used completely in userspace (using e.g. wgslirpy or onetun). |
@vi Would Wireguard actually help with this? I'm assuming my issue is not just mild packet loss along the way but some reverse proxy that abruptly closes websocket TCP connection. I'm really cautious about adding more layers since that would be, like what, TCP (SSH) in UDP (WG) over TCP (WS)? |
Dropped unacknowledged data when this happens would be interpreted as a packet loss by upper TCP layer.
Yes, it is TCP over TCP, which is problematic. The same layer that helps recover the data on reconnections would also cause slowdowns and overhead. Maybe this specific task (good reliable stream socket over series of unreliable stream sockets) needs to be solved separately, with a dedicated tool. Maybe I'll roll such tool someday. |
On Windows 10, I can run this command with no problems:
Is it possible to use the
autoreconnect
option as well? I haven't been able to figure out the syntax for this. I've tried these without any luck:Thank you for creating and sharing wonderful utility.
The text was updated successfully, but these errors were encountered: