[99s-extend] websocket handler

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


Thanks Loïc.

Samir

> On 30 mars 2015, at 17:18, Loïc Hoguin <essen at ninenines.eu> wrote:
> 
> [<Opts>] is "Opts" in init/3. Whatever value you put there you receive in your handler.
> 
> On 03/30/2015 05:12 PM, Samir Sow wrote:
>> 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
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
>> 
> 
> -- 
> Loïc Hoguin
> http://ninenines.eu



More information about the Extend mailing list