Git Product home page Git Product logo

Comments (6)

matvore avatar matvore commented on June 2, 2024

from websocketd.

standzhou2 avatar standzhou2 commented on June 2, 2024

thank you so much
i just have a try, it seems not work.

image

image

from websocketd.

matvore avatar matvore commented on June 2, 2024

I looked a little more closely.

The gorilla/websocket library that websocketd uses allows sending a CloseMessage and other control messages, but websocketd doesn't expose an API to use that.

If you attempt to write 0xff, 0x00 or other control codes in the websocket script, websocketd ends up treating that as plain data, and wrapping that in a data packet when sending to the client. This includes the case of passing --binary to websocketd.

Maybe you can use some app-specific indicator, a normal data packet, for the server to communicate clean closure?

from websocketd.

ctn-malone avatar ctn-malone commented on June 2, 2024

If you're under linux, you can try to use https://github.com/ctn-malone/websocketd-controller which can be used as a wrapper around your script and will forward stdout, stderr & exit event (which contain the exit code of the wrapped script)

from websocketd.

asergeyev avatar asergeyev commented on June 2, 2024

What is difference that clean:true would make?

from websocketd.

ctn-malone avatar ctn-malone commented on June 2, 2024

It’s just an easy way to get json events everytime something is outputted to stdout, stderr or if the program exits. I like the standard way of communicating it provides but I might be a bit biased 😅

Edit: on second thought, I probably misread @asergeyev question (I thought you asked what benefit would be provided by the wrapper)

from websocketd.

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.