News for hackers. Stuff that matters.

asergeyev

Re:Show HN: A Unixy approach to WebSockets on Monday February 16, 2015 @10:22PM (#9060503)
There is nothing wrong with server side events. I even played with them already.

But for bi-directional communication we do have to use websockets and it's the good tool for the job.

If you'd like to see maybe event source is something that could be added to websocketd as additional protocol, start conversation in issues, nothing is wrong with pitching an idea. We already got cgi and static html because it's not always about websockets, sometimes you want other things handy.

Re:Show HN: A Unixy approach to WebSockets on Monday February 16, 2015 @10:19PM (#9060493)
rapind did nice experiment in comments above.
Re:Show HN: A Unixy approach to WebSockets on Monday February 16, 2015 @05:03PM (#9059340)
Thanks for that experiment!
Re:Show HN: A Unixy approach to WebSockets on Monday February 16, 2015 @05:02PM (#9059334)
Difference with cgi is that they are live and die, with each user request. websocketd programs are more like "one per user session"... Makes sense when your user sessions are lengthy.
Re:Show HN: A Unixy approach to WebSockets on Monday February 16, 2015 @09:55AM (#9057113)
Please ignore complexity of supplied examples... It's really not for that kind of use. I have lots of scripts that do something like this (and most of them are not in bash :)...):

    while read ARG; do
          if validate $ARG; then
                run_something $ARG
          fi
    done
Most of my "validate" pieces are bash functions and most "run_something" return lengthy CSV datablocks.

Then, there is the javascript that uses user mouse (and other signals) to generate arguments to send to websocketd and draw pretty visuals based on data that arrives back.

Re:Show HN: A Unixy approach to WebSockets on Sunday February 15, 2015 @09:56AM (#9052736)
Since there is so much pointless discussion about use of text streams under this comment.

When someone has example of situation when binary, json or other communication between websocketd and program is needed, please just file a ticket, it would be great to see practical situation instead of just arguing with each other about text stream/unix principles/json and other stuff.

Re:Show HN: A Unixy approach to WebSockets on Saturday February 14, 2015 @07:22PM (#9051284)
Untold rule is not to run "sudo websocketd --devconsole bash" :)
Re:Show HN: A Unixy approach to WebSockets on Saturday February 14, 2015 @07:10PM (#9051254)
Not supported in any of IE versions... https://status.modern.ie/serversenteventseventsource?term=Ev...

And WebSockets is working since IE10 https://status.modern.ie/websocket?term=WebSocket

Re:Show HN: A Unixy approach to WebSockets on Saturday February 14, 2015 @07:05PM (#9051234)
There is closed ticket (github.com/joewalnes/websocket) where we were battling this out, you're always welcome to join with good ideas, that would be appreciated.
Re:Show HN: A Unixy approach to WebSockets on Saturday February 14, 2015 @06:58PM (#9051212)
Pretty much. Good example is Joe's vmstats https://github.com/joewalnes/web-vmstats
Re:Show HN: A Unixy approach to WebSockets on Saturday February 14, 2015 @06:56PM (#9051205)
Also websocketd is multiplatform and does not require python. Neither good or bad, just another difference :)

Also, not sure if websocketify can but websocketd also has --dir argument and can supervise and route many sockets to many different programs.