Revel provides support for Websockets.

To handle a Websocket connection:

  1. Add a route using the WS method.
  2. Add an action that accepts a revel.ServerWebSocket parameter.

See the example chat application

Simple Websocket Example

Add this to the conf/routes file:

WS /app/feed Application.Feed

Then write an action like this:

import "github.com/revel/revel"

func (c App) Feed(user string, ws revel.ServerWebSocket) revel.Result {
	...
}