I am trying to create a simple WebSocket connection in JavaScript against my Rails app. I get the following:
WebSocket connection to 'ws://localhost:4000/' failed: Error during WebSocket handshake: 'Sec-WebSocket-Accept' header is missing
What am…
this is my first time using websockets and I am having trouble getting my server to work. Below is the simple em-websocket server I copied from this github page. It's basically unchanged right now so it looks like so:
require 'em-websocket'
EM.run…
I am trying to get an EventMachine server that runs when I run my rails server and not as a separate process.
So for example, using the simple server example from here (em-websocket) you get the following (standalone?) ruby code:
EventMachine.run…
I'm writing a simple chat application. The only "front-end" required is a single html file, a javascript file, and a few stylesheets. The majority of the application is the server-side EventMachine WebSocket server.
I'm also trying to host this on…
My goal is to connect an Adafruit Feather (WiFi) to a Websocket Server running on my computer.
Server: EventMachine Simple Server Example
Clients: ArduinoHttpClient > SimpleWebsocketExample
My issues is that when I reset my Feather, I sometimes…
Currently, I am using websockets to send an image to my server, process it, and then send it back. Specifically, I am using Ruby with Sinatra and sinatra-websocket.
On my development server, it takes ~2 seconds to send an image to the server and…
Am creating a WebSocket application which will connect with wss url (say wss://someurl).
I got some sample code from here https://github.com/elabs/mobile-websocket-example which is simple chat app. This is working fine for ws protocol. But when I…
Maybe it is a good example for server push system. There are many users in the system, and users can talk with each other. It can be accomplished like this: one user sends message(through websocket) to the server, then the server forward the message…
I'm using Faye and EventMachine to open a socket to another server. The server times out if it doesn't detect activity. How do I send the file (binary encoded) so the server doesn't time out?
Here's what I have:
media_path =…
I try to build a billboard for displaying messages in a browser initiated by the server using sinatra. The obviest thing to do in the servercode was like this:
server:
require 'em-websocket'
require 'yajl'
require 'haml'
require…
Rails 4.1.8, ruby 2.1.5p273
I try to get session id from inside EventMachine::WebSocket thread.
session and cookie objects are not avaible here, so it need to manually decrypt cookie from websocket handshake headers. Cookie is smth like…
Is there a way to send messages on different channels using the sinatra-websocket gem?
Basically I'm trying to replace Pusher with sinatra-websocket. Here's what I'm doing with Pusher:
Pusher["my_channel_A"].trigger('some_event_type',…
I'm running JRuby-1.7.3 through rvm. I've successfully installed the em-websocket-server gem. I can verify it's in my current gemset by running $ gem list.
My code is this:
require 'rubygems'
require 'em-websocket-server'
class EchoServer <…
I need to create a web-socket server, I am planning to use em-websocket. I need to support private channels, that is I should be able to send message to one particular channel or subscriber.
There are many good chat examples that are in broadcast…
I want to show my program's progress (exemplified here as a loop) on a website in real-time.
If I have a proper Ruby server running, a client should be able to connect to the server via websockets using a browser, and, once connected, receive…