[99s-extend] websocket handler

Samir Sow samset at wanadoo.fr
Mon Mar 30 17:12:12 CEST 2015


Hi,

I would like to pass data to my websocket handler (Opts params).

init({tcp, http}, Req, Opts) ->
	{upgrade, protocol, cowboy_websocket, Req, Opts}.

websocket_init(_TransportName, Req, Opts) ->

I guess the Opts param is read from the routing data.
What’s the right syntax to do that.

Dispatch = cowboy_router:compile([
		{'_', [
			{'_', <my_handler>, [<Opts>]}
		]}
	]),

Thank you.

Sincerely.

Samir Sow


More information about the Extend mailing list