Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Alkor San
    @alkorsan
    ah yes this solution have a problem I couldn t solve:
    Vitaly Shukela
    @vi
    Depending on definition of "safer".
    Alkor San
    @alkorsan
    I will test both then and compare
    Vitaly Shukela
    @vi
    Even with reuse-raw: there expected to be lost messages, because of there is no good propagation of "can't write to this connection" status (which happens when somebody disconnects).
    Alkor San
    @alkorsan
    using sh-c: or cmd: I remember I could n t make for exemple the command timeout to work inside the subshell, that is why I prefered to use reuse-broadcast: , because I can use it in the same shell without limitation
    Vitaly Shukela
    @vi
    -E (--exit-on-eof) option can also improve this, as dead connections would go away sooner rather than later.
    What is the problem with command timeout?
    Alkor San
    @alkorsan
    it stops working inside sh-c:
    Vitaly Shukela
    @vi
    What is the command timeout?
    it stops working inside a subshell as I had read in stackoverflow
    Vitaly Shukela
    @vi
    So it is the timeout I was thinking about... Should websocat itself be timed-out or some particular command inside script executed by websocat?
    I don't expect any surprises involing timeout with websocat a top of usual timeout's trickiness.
    Alkor San
    @alkorsan
    I needed the timeout because I dodnot know how to make websocat cut the conexion and continue withe next step
    but you gaved me other solutions after that solved that
    Vitaly Shukela
    @vi
    Very basic example works for me:
    websocat -t - cmd:'while true; do timeout 1 sh -c "echo Type something; read A; echo You typed \$A." || echo timed out; sleep 1; done'

    cut the connection and continue withe next step

    Cut the entire WebSocket connection or just a step in WebSocket session?

    Alkor San
    @alkorsan
    oops sorry , yes just a step in WebSocket session
    Vitaly Shukela
    @vi
    Just use bash's read -t?
    Alkor San
    @alkorsan
    read -t had problems too: I have to know the number of lines I will receive to use it
    and chrome send diferent lines everytime ; i can t teel read how much lines I will receive
    Vitaly Shukela
    @vi
    In websocat's default text mode 1 line == 1 message. As soon as you receive a message, exactly one read -t should return, as far as I understand.
    Alkor San
    @alkorsan
    yes true; but I need to receive more than one message sometimes so read did t gave this flexibility
    Vitaly Shukela
    @vi
    Are you familiar with expect(1) program? It should be able to drive websocat too. Maybe it is a good choice when there are multiple line types and timeouts involved.
    Alkor San
    @alkorsan
    yes
    yes I m leaving it as my last solution
    Vitaly Shukela
    @vi
    Maybe websocat + bash combo is just not enough for the task. websocat + your_C_or_python_program or just your_python_program would be more fit for production.
    Alkor San
    @alkorsan
    because I found that websocat solved everything
    I don t think I need it now you made websocat a swissknife now
    but you already solved everything sir!
    it works super
    the new errors are not related to this problem at all
    Vitaly Shukela
    @vi
    OK. But if you need stability and resilience in corner cases, the exact details of websocat usage need to be reviewed.
    Please close the GitHub issues that you think are not relevant anymore.
    Alkor San
    @alkorsan
    ok
    Vitaly Shukela
    @vi
    Uploaded the 1.0.0 release files.
    Alkor San
    @alkorsan
    congratulation
    I tested wss and still have the same error!
    Vitaly Shukela
    @vi
    What about the pre-built executable?
    What about the mentioned cargo run command?
    Alkor San
    @alkorsan
    I m just attempting to test cargo run
    the pre-built exes gave the same error
    Vitaly Shukela
    @vi
    Reproduced the issue locally.
    Alkor San
    @alkorsan
    ok
    the same error with cargo run:
    websocat: Unknown address or overlay type of wss://echo.websocket.org
    error: process didn't exit successfully: binbadr\release\websocat.exe -v wss://echo.websocket.org
    (exit code: 1)
    Vitaly Shukela
    @vi
    Pushed to git and re-uploaded websocat_win32.exe and websocat_win64.exe to the release.
    Alkor San
    @alkorsan
    ok I will test
    now it works :)
    thank you
    both 32 / 64