Giter Club home page Giter Club logo

Comments (3)

AlwaysNoobCoder avatar AlwaysNoobCoder commented on June 3, 2024

@vi maybe this is silly, but can you give some inputs ?

from websocat.

vi avatar vi commented on June 3, 2024

Typically when recv(3) or read(3) syscall returns 0 bytes or maybe after receiving WebSocket close message.

By default (without -E) it waits for the other direction to also return 0 bytes before considering the connection as finished. With -E it drops possible future or pending data and closes the other direction immediately.

For example, in this invocation:

websocat wss://ws.vi-server.org/mirror

there are two directions:

  1. Reading from stdin and writing to a WebSocket
  2. Reading from the WebSocket and writing to stdout

If you press Ctrl+D, you cause stdin to signal end-of-file, so it finishes the first direction. If WebSocket sends close message or drops the connection, it finishes the second direction.

from websocat.

AlwaysNoobCoder avatar AlwaysNoobCoder commented on June 3, 2024

@vi thanks!
without -E , websocat command will not exit, even the server already closed the websocket session, this behaviour is a bit confusing for me.

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.