websocketd
websocketd copied to clipboard
A client like websocketd
Firstly, thanks for your work. I like websocketd and works fine for me.
Do you know a websocket client like websocketd?
Any comments on intent? Technically it's not hard, few days of not intense part-time hacking but I do not see benefit for the project yet.
BTW a huge +1 from me on this. There was one I used a while back (I can't remember the name, I think it was written in Ruby, or possibly Node). I always thought it would be useful if websocketd had a companion project: websocketc
.
Here's where it's useful:
- Quick cmd line testing of endpoints (like curl)
- Shell scripting (e.g. fetching data from services to feed into scripts)
- Transformations (e.g. a websocketd endpoint could call websocketc and transform live results)
- Wiring backend services together without browsers (WebSockets have some value-add on top of raw TCP sockets including path based routing, headers, authentication, and message framing)
How will we call it ? :)) wscat? :)
tail -f mylog | wscat http://server:port
wscat http://sever:port > output
Like this?
Still line==message protocol, right? (which also makes it different from curl with fake WS headerset)
Wow.. believe or not but I was making name and apparently I guessed to this: https://www.npmjs.com/package/wscat
but since someone posted https://www.npmjs.com/package/websocketdjs I think stealing name is bad thing :)
how about websocketc then?
Thanks!
https://github.com/websockets/wscat doesn't wait for a connection to process the input (https://github.com/websockets/wscat/issues/4) and I cannot pipe the output.
wsdump from https://github.com/liris/websocket-client decorates de output and breaks with piped input (https://github.com/liris/websocket-client/issues/183).
https://github.com/daniellandau/wssh doesn't process my input.
If someone starts on it, mark the ticket please. So far I think I can only get to it closer to end of May... It's really small thing to do and it's silly to make excuse but I just have to focus on other project this/next week.
The issue of wsdump was solved :) And I modified it to run the way I wanted. https://github.com/liris/websocket-client/pull/186
I'll keep it open for a bit, we may better to have one anyway, just to test libs as well.
It's fine!
One use case for this client is so that git can use websocket as a transport, which would be more efficient than git's plain http support.
I can see many reasons for this. For example, I build Home Automation solutions on ARM-based systems and need to connect via ws. Currently I use various libraries which haven't been very suitable in this case. Something just like websocketd for client would be awesome to have!
In my case I can't easily run many languages (other than tcl) so all the python and perl and whatever other scripts might exist never end up being very helpful. I have it all running in tcl but a go-based binary would be absolutely awesome!
@bradennapier Can you try to describe how you see this one work?
Say someone runs websocketd server somewhere... then idea is to use wscat like program on your laptop or micro-computer to do what? I really lack context here... What data will be input and where will it go normally for automation for example? How much messages, will they all be plain text?
I mean lets say the simple case where you want to connect to a websocket server and communicate with it. In my case I have a system behind a LAN and I connect to the websocket server running on the server from the LAN so that I can begin two-way communication to and from without port forwarding.
I would imagine it work the same way - the program simple connects the websocket
websocketc --address=serverpath --port=port ...
then websocketc executes the given program immediately (and assumes it would likely stay connected until terminated by one end) and writes to stdin / out so that the application can now listen to that and communicate with the server.
I would use primarily json but i would imagine it wouldn't matter
I was thinking of writing a vim plugin that communicated to a server via websockets. I haven't fleshed out the idea, but having something like websocketc
to tie into vim would be pretty nifty.
A websocketc would be super useful for me as well! I'm using (the awesome) websocketd because I'm writing performance-critical computer vision code in C++, which is a tough language to develop in especially by today's standards, so it's a lifesaver to be able to simply read/write on the console to send the data; then I can keep the C++ code to only computer vision code. I will have more than one of these nodes, connected in a chain or hub pattern, so I am also looking for a similarly simple "websocketc" solution.
Was there any progress on this? I would still be pretty useful...
So ++1
A websocketc instance that simply runs as a client capable to have a constant connection to another node with websocketd would be useful in so many cases.
I personally had that need in the last couple of months and I ended up writing custom ncat solution in one case, and php solution for the other. Alas, they are both proprietary so I can't share the codebase.
Bottom line, I truly believe that bundling this up in the project will have vast success!
I'm interested in a websocketc (a client using python) for data gathering live datasets for data science from websockets all across the internet. I tried websocket-client but I couldn't get it to work. [https://github.com/websocket-client/websocket-client/issues/560]
Not exactly what most of these comments are looking for, but I had a use case for a browser based way to easily connect to, view, and manage websocketd servers. Might be helpful! Websocketc.com
@andrewmh20 -> trying to connect to the site quickly exposed the problem: the site took 10++ seconds to load, so a real (local) client would be preferable...
@andrewmh20 -> trying to connect to the site quickly exposed the problem: the site took 10++ seconds to load, so a real (local) client would be preferable...
That’s because it’s running on free heroku right now....didn’t realize it was so bad but I should fix that if people are looking. All the actual connections are made directly from the client to whatever url you put in, including local ones.
Wrapping that in a binary client which would run locally would be a good thing, however :)