I try to use eventmachine + em-websocket + redis to build a notification server. It looks good after I finishing almost all code. But, when I started to test connections, something happened. Connection can't be over than 1015 (I have no idea why…
So I'm attempting to setup em-websocket (or potentially Goliath), so that users can come to a different route and thusly be subscribed to only that channel, so for example:
example.com/channel_1
Browsers open there will only receive messages…
I'm trying to run a webserver and websocket server on port 80. To do this I'm using HAProxy to route the connections using this config:
global
maxconn 4096 # Total Max Connections. This is dependent on ulimit
nbproc 1
ulimit-n …
I'm writing a chat server application where the users can exchange messages with one of his friends. When the user connects i store his connection on an class variable hash:
@@connections[:user_id] = conn
When someone sends the user a message, I…
I have a little WebSocket chat demo that I am working on (based on this code). However, the part that doesn't seem to be working is when a connection is closed between a client and the server, I want to notify all the subscribers that the user has…
I have a Ruby application running with Puma. Now I wanted to add a websocket to broadcast REST requests to the connected clients. I managed to create a websocket server with em-websocket gem just by adding some code in my config.ru:
…
I am trying to support a WebSocket interface to my Rails application. I am on Rails 4 with no plans of moving to Rails 5 immediately. I use Phusion Passenger 5.0.30 behind nginx.
I want to use em-websocket (+eventmachine) to build this support. What…
I'm writing rails app and i want user to receive notification as soon as new message is saved to DB. For websocket i'm using em-websocket gem. After connection, i store client id and socket instance in array.
Question: How to push data to the…
I use em-websocket gem in Rails application. WebSocket server runs in the initializer, this is how it looks:
#config/initializers/web_socket.rb
EM.next_tick do
EM::WebSocket.run(host: '0.0.0.0', port: 8080) do |ws|
ws.onopen do |request|
…
I want to handle differently different cases of WebSocket connection termination. I should send email if it's terminated on client side by logout or browser closing. And I should do nothing if it's terminated on server side (for example after the…
I am new to ruby. I am trying to implement a chat client using em-websocket. I have the following code:
EventMachine::WebSocket.start(host: '0.0.0.0', port: 8080) do |websock|
websock.onopen do
puts 'New Connection Opened'
cookies…
I am developing a real-time application using EventMachine. Two clients, A and B, connect to an EventMachine server over standard TCP, or via WebSocket with em-websocket.
Every time data goes through EventMachine, code execution takes a 95ms hit.…
I have two websocket clients, and I want to exchange information between them.
Let's say I have two instances of socket servers, and 1st is retrieve private information, filter it and send to the second one.
require 'em-websocket'
EM.run do
…
My webapp consits of a HTTP server and a WebSocket server, both running on Rails. For Websockets I am using em-websocket which I start in the initializers, like this:
Thread.new do
EventMachine.run do
…