postrank-labs/goliath — Issue #153: Having an HTTP server with WebSockets
Author: wolfscaptain
Created: 2012-03-06 21:39:09+00:00
State: open

This isn't an issue, but I am not sure if there's another place to write this.

I am trying to use Goliath as a simple HTTP server with WebSocket support, but I simply can't get the WebSockets to work.

My main Goliath API class is a simple mapping:

class HttpServer < Goliath::API
map "ws:*", WebSocketEndPoint

map "/*", HttpEndPoint do
use Goliath::Rack::Params
use Goliath::Rack::Validation::RequestMethod, %w(GET POST)
end
end

The HttpEndPoint works well, but I can't manage to connect to the WebSocket through a browser.
The implementation is just the WebSocket example from the Goliath examples here on github.

I am trying to connect to "ws://MY_IP/websocket.html" where "websocket.html" is just an arbitrary file.

Am I doing something wrong?

Thanks.