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

Forward server message error in windows(64/32) #145

Open vegalou opened 2 years ago

vegalou commented 2 years ago

@vi

Dear Vitaly Shukela:

Thanks for your help and effort on this Project websocat

Since last issue, I could redirect websocket server message in Linux. websocat_linux64 works fine as expected for forwarding.

https://github.com/vi/websocat/issues/143

There is one difference between linux and windows version, I'd try both win64 and win32 versions(1.9.0 & 1.8.0),

ig, client connect to server in Linux, message wrote in debug file:

websocat -nu -t "ws://myServer.com/my_channel_1?_=1643278479722&tag=&time=&eventid=" foreachmsg:sh-c:"curl -s -X POST http://127.0.0.1/tool/post.php -d @-"

Redirection works as expected. But in Windows versions, error message shows in conosle:

[ERROR websocat::foreachmsg_peer] Reconnecting failed. Trying again in tight end less loop.

Message not forwarded after above message.

Thank you for your assistance sincerelly.

Best Regards.

vi commented 2 years ago

Assuming you want to forward server errors from the curl part of the command line, you can use curl's -v option to print diagnistics to stderr (it won't get into Websocat, but directory to console).

Otherwise I don't understand what server message error you are asking about. Do you mean the CloseFrame content?

vegalou commented 2 years ago

Hi vi,

I'm trying to use Websocat as a Websocket Client forward received message to http server. Linux version of Websocat works correctly, but windows version shows the message without forwarding.

[ERROR websocat::foreachmsg_peer] Reconnecting failed. Trying again in tight end less loop.

I could work it out in Pure PHP Websocket Client, thanks for your share and help.

@vi