websocket-ruby | Universal Ruby library to handle WebSocket protocol | Websocket library
kandi X-RAY | websocket-ruby Summary
kandi X-RAY | websocket-ruby Summary
Universal Ruby library to handle WebSocket protocol. It focuses on providing abstraction layer over WebSocket API instead of providing server or client functionality. Autobahn tests: server, client.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns a string representation of this object .
websocket-ruby Key Features
websocket-ruby Examples and Code Snippets
Community Discussions
Trending Discussions on websocket-ruby
QUESTION
I'm trying to connect to the Liquid exchange's Stream API with pusher. Documentation here
I have constructed a function that is in line with the Pusher library's documentation. Link to that here My current code looks like this:
...ANSWER
Answered 2020-Mar-07 at 02:32The error comes from tcpsocket.new (Ruby https://ruby-doc.org/stdlib-2.5.1/libdoc/socket/rdoc/TCPSocket.html) in websocket line 17: https://github.com/pusher-community/pusher-websocket-ruby/blob/master/lib/pusher-client/websocket.rb
ws_host tap.liquid.com 80 seems to be invalid, https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol
I have tried using a secure connection, at least in the browser and got a 404 for ws and invalid request, which is good in this case, for https (https://tap.liquid.com/).
You need to configure ssl in the client configuration, but the pusher-client gem as well as one other I have found are pretty old. Maybe it is wise to switch to a more up-to-date library like https://github.com/pusher/pusher-http-ruby/blob/master/README.md
The example contains an option for activated SSL.
QUESTION
Using faye-websocket and EventMachine the code looks very similar to faye-websocket's client example:
...ANSWER
Answered 2017-Feb-28 at 15:39Here's one way to do it.
First, you have to accept that the EM thread needs to be running. Without this thread you won't be able to process any current connections. So you just can't get around that.
Then, in order to add new URLs to the EM thread you then need some way to communicate from the main thread to the EM thread, so you can tell it to launch a new connection. This can be done with EventMachine::Channel
.
So what we can build now is something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install websocket-ruby
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page