vi / websocat

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

`let res = stage1.custom_headers(&h);` got block #214

Closed zemelLeong closed 5 months ago

zemelLeong commented 5 months ago

Hi. I dont know why got block when I try to run this project. That's weird recording

vi commented 5 months ago

What is the Websocat command line in use? I see only the leading part: ws://report-workser-....

The pane on the left suggests you have inserted a number of println!s. If the command line suggests Websocat should output WebSocket message to stdout (the same as println!) then it may deadlock. Better use eprintln! instead of println! for this.

Maybe server started sending headers, but failed to finish it?

You may want to use advanced command line with traffic logging to see what Websocat sends to server and what server sends back to Websocat.

zemelLeong commented 5 months ago

Thank you very much. eprintln! is worked. The full command is cargo run -- ws://report-worker-2.noscription.org -H "Origin: https://noscription.org" -H "User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'". How can I use custom headers option in advanced command?

I'm trying to use websocket connect to report-worker-2.noscription.org got 403 forbidden. Is it possible to integrate websocat as a dependency into my project?

vi commented 5 months ago

How can I use custom headers option in advanced command?

-H should work the same way regardless of whether it is simpler or flexible mode.

zemelLeong commented 5 months ago

I can get data using this command:

websocat wss://report-worker-2.noscription.org -H "Origin: https://noscription.org" -H "User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'"

image

but use this command cannot load data:

websocat -t - --ws-c-uri=ws://report-worker-2.noscription.org -H "Origin: https://noscription.org" -H "User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'" --tls-domain=echo.websocket.org ws-c:ssl:log:tcp:echo.websocket.org:443

image

vi commented 5 months ago

but use this command cannot load data ... tcp:echo.websocket.org:443

What data do you expect from echo.websocket.org? It would just send back the data you have sent to it.

Maybe you meant --tls-domain report-worker-2.noscription.org ws-c:log:ssl:tcp:report-worker-2.noscription.org:443?

zemelLeong commented 5 months ago

thank you. This is what i wanted