Giter Site home page Giter Site logo

Comments (19)

vi avatar vi commented on May 11, 2024

What is the websocat command line? Is there -E option? Maybe autoreconnect: is in effect?

from websocat.

therealprof avatar therealprof commented on May 11, 2024

I'm using websocat -vvv -s 8090:

Listening on ws://127.0.0.1:8090/
[INFO  websocat::lints] Auto-inserting the line mode
[DEBUG websocat] Done third phase of interpreting options.
[DEBUG websocat] Done fourth phase of interpreting options.
[DEBUG websocat] Preparation done. Now actually starting.
[INFO  websocat::sessionserve] Serving Message2Line(WsServer(TcpListen(V4(127.0.0.1:8090)))) to BroadcastReuser(Line2Message(Stdio)) with Options { websocket_text_mode: true, websocket_protocol: None, udp_oneshot_mode: false, unidirectional: false, unidirectional_reverse: false, exit_on_eof: true, oneshot: false, unlink_unix_socket: false, exec_args: [], ws_c_uri: "ws://0.0.0.0/", linemode_strip_newlines: false, linemode_strict: false, origin: None, custom_headers: [], websocket_version: None, websocket_dont_close: false, one_message: false, no_auto_linemode: false, buffer_size: 65536, broadcast_queue_len: 16, read_debt_handling: Warn, linemode_zero_terminated: false, restrict_uri: None, serve_static_files: [], exec_set_env: false, reuser_send_zero_msg_on_disconnect: false, process_zero_sighup: false, process_exit_sighup: false, socks_destination: None, auto_socks5: None, socks5_bind_script: None, tls_domain: None, tls_insecure: false, max_parallel_conns: None }

from websocat.

therealprof avatar therealprof commented on May 11, 2024

These are the last lines of output:

[INFO  websocat::ws_server_peer] Upgraded
[INFO  websocat::broadcast_reuse_peer] Reusing
[TRACE websocat::my_copy] poll
[TRACE websocat::my_copy] poll
[TRACE websocat::my_copy] poll
[DEBUG websocat::ws_peer] drop WsWriteWrapper
websocat: WebSocketError: WebSocket data frame error

from websocat.

vi avatar vi commented on May 11, 2024

Is it reproducible when using websocat ws://127.0.0.1:8090 as a client and interrupting it with Ctrl+C? What platform is it on? Linux,Windows,Mac,Other?

Debugging output for myself when I start server, connect with another websocat, then terminate it:

$ websocat -vvv -s 8090
Listening on ws://127.0.0.1:8090/
[INFO  websocat::lints] Auto-inserting the line mode
[DEBUG websocat] Done third phase of interpreting options.
[DEBUG websocat] Done fourth phase of interpreting options.
[DEBUG websocat] Preparation done. Now actually starting.
[INFO  websocat::sessionserve] Serving Message2Line(WsServer(TcpListen(V4(127.0.0.1:8090)))) to BroadcastReuser(Line2Message(Stdio)) with Options { websocket_text_mode: true, websocket_protocol: None, udp_oneshot_mode: false, unidirectional: false, unidirectional_reverse: false, exit_on_eof: true, oneshot: false, unlink_unix_socket: false, exec_args: [], ws_c_uri: "ws://0.0.0.0/", linemode_strip_newlines: false, linemode_strict: false, origin: None, custom_headers: [], websocket_version: None, websocket_dont_close: false, one_message: false, no_auto_linemode: false, buffer_size: 65536, broadcast_queue_len: 16, read_debt_handling: Warn, linemode_zero_terminated: false, restrict_uri: None, serve_static_files: [], exec_set_env: false, reuser_send_zero_msg_on_disconnect: false, process_zero_sighup: false, process_exit_sighup: false, socks_destination: None, auto_socks5: None, socks5_bind_script: None, tls_domain: None, tls_insecure: false, max_parallel_conns: None }
[INFO  websocat::net_peer] Incoming TCP connection from Some(V4(127.0.0.1:47864))
[DEBUG websocat::sessionserve] Underlying connection established
[INFO  websocat::sessionserve] Serving 1 ongoing connections
[INFO  websocat::ws_server_peer] Incoming connection to websocket: /
[DEBUG websocat::ws_server_peer] Incoming { version: Http11, subject: (Get, AbsolutePath("/")), headers: Headers { Host: 127.0.0.1:8090
, Connection: Upgrade
, Upgrade: websocket
, Sec-WebSocket-Version: 13
, Sec-WebSocket-Key: smVW/7cfNRxR3xDJ6S6a+Q==
, } }
[DEBUG websocat::ws_server_peer] Headers { }
[DEBUG websocat::ws_server_peer] Headers { Sec-WebSocket-Accept: y+RH4hFg6GFtCQKH//rfTJpuqZ8=
, Connection: Upgrade
, Upgrade: websocket
, }
[INFO  websocat::ws_server_peer] Upgraded
[INFO  websocat::broadcast_reuse_peer] Initializing
[INFO  websocat::stdio_peer] get_stdio_peer (async)
[INFO  websocat::stdio_peer] Setting stdin to nonblocking mode
[INFO  websocat::stdio_peer] Installing signal handler
[DEBUG websocat::ws_peer] incoming text
asdf
[DEBUG websocat::ws_peer] incoming text
safddsf
[DEBUG websocat::ws_peer] incoming None
[DEBUG websocat::my_copy] BrokenPipe: read_done
[DEBUG websocat::my_copy] done
[INFO  websocat::sessionserve] Forward finished
[INFO  websocat::sessionserve] Forward shutdown finished
[INFO  websocat::sessionserve] One of directions finished
[DEBUG websocat::ws_peer] drop WsWriteWrapper

from websocat.

therealprof avatar therealprof commented on May 11, 2024

Is it reproducible when using websocat ws://127.0.0.1:8090 as a client and interrupting it with Ctrl+C?

Yes.

What platform is it on? Linux,Windows,Mac,Other?

Mac

from websocat.

vi avatar vi commented on May 11, 2024

Seems to be not reproducible on Linux; I'll try on Mac later.

Which version of Websocat do you use? 1.3.0? Is it also reproducible with 1.2.0 or 1.1.0?

from websocat.

therealprof avatar therealprof commented on May 11, 2024

I haven't tried older versions, only 1.3.0. I also tried bumping all dependencies (except hyper which is API incompatible) but no change.

from websocat.

vi avatar vi commented on May 11, 2024

Tried on Mac myself for 1.3.0 and 1.2.0 and can't easily reproduce it.

Are you building websocat yourself or using Github release?

from websocat.

therealprof avatar therealprof commented on May 11, 2024

cargo installed it.

from websocat.

therealprof avatar therealprof commented on May 11, 2024

Same behaviour with websocat_mac downloaded from GitHub, though.

from websocat.

vi avatar vi commented on May 11, 2024

Is it the same for https://github.com/vi/websocat/releases/download/v1.3.0/websocat_mac?

Looks like yes...

from websocat.

vi avatar vi commented on May 11, 2024

Does it accept new connections while busy looping after bug?

from websocat.

vi avatar vi commented on May 11, 2024

Is it the same for older websocat like https://github.com/vi/websocat/releases/download/v1.1.0/websocat_mac

from websocat.

vi avatar vi commented on May 11, 2024

Can you try to dtruss it? Which syscalls are invoked before and when it is busy looping?

from websocat.

therealprof avatar therealprof commented on May 11, 2024

Same thing for v1.1.0. But I'm afraid I don't really have time to deeply analyse it right now.

from websocat.

vi avatar vi commented on May 11, 2024

What version of OS X?

We can analyse it later; I'm not sure how to address it by myself (I'm not a Mac user in general).

One of experiments: running websocat -t -E tcp-l:127.0.0.1:8090 - (i.e. just a TCP server, not WebSocket server) and checking if the bug can be still triggered.

from websocat.

therealprof avatar therealprof commented on May 11, 2024

macOS 10.12.6

from websocat.

therealprof avatar therealprof commented on May 11, 2024

websocat -t -E tcp-l:127.0.0.1:8090 - -> same problem

from websocat.

vi avatar vi commented on May 11, 2024

So the problem seems to be independent of WebSockets.

Can you try running this TCP echo server: https://github.com/tokio-rs/tokio/blob/master/examples/echo.rs and checking if has the problem (not necessary now, when you have time for this). If needed I can make a pre-built version.

from websocat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.