vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
7.18k stars 278 forks source link

[Question] Keep connection open in the background. #94

Closed mygizli04 closed 3 years ago

mygizli04 commented 4 years ago

So, i want websocat open in the background, listening to tcp connections, which accepts requests i make with nc

So: Main script ---> Activates background script ---> Background script opens websocat and listens in the background ---> Main script uses nc to give commands for websocat to send ---> websocat sends the command ---> Connection doesn't close and a new message can be sent any time with the current connection.

or more preferably: Main script ---> Activates websocat in the background ---> Messages can be sent and connection never closes

vi commented 4 years ago

Do you want something like this?

mygizli04 commented 4 years ago

Yes that's perfect! However i couldn't get it to work, because basically when the websocket i'm trying to open a connection to responds BEFORE i send anything, it breaks. For the echo server it works fine because i'm not getting any data before i send anything, but when the server sends anything before i do i cannot send anything, and whenever i try to connect to the tcp server i get the first message sent again

mygizli04 commented 3 years ago

Oh i didn’t realise this issue was still open, well it’s solved.