From samset at wanadoo.fr Thu Mar 19 18:08:54 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Thu, 19 Mar 2015 18:08:54 +0100
Subject: [99s-extend] cowboy websocket example runtime error
Message-ID: <[email protected]>
Hi there,
I would appreciate your help to understand the following error when running the websocket example.
Context is :
ERL 17
Cowboy 2.0.0-pre (master)
no source modification
=ERROR REPORT==== 19-Mar-2015::18:04:36 ===
Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
Thank you.
Samir
From essen at ninenines.eu Thu Mar 19 18:10:29 2015
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 19 Mar 2015 18:10:29 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>
How do you run it?
On 03/19/2015 06:08 PM, Samir Sow wrote:
> Hi there,
>
> I would appreciate your help to understand the following error when running the websocket example.
>
> Context is :
>
> ERL 17
> Cowboy 2.0.0-pre (master)
> no source modification
>
>
> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>
> Thank you.
>
> Samir
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>
--
Lo?c Hoguin
http://ninenines.eu
From stephane at wirtel.be Thu Mar 19 18:10:58 2015
From: stephane at wirtel.be (=?utf-8?q?St=C3=A9phane?= Wirtel)
Date: Thu, 19 Mar 2015 18:10:58 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>
do you have a priv/ directory in your application ?
On 19 Mar 2015, at 18:08, Samir Sow wrote:
> Hi there,
>
> I would appreciate your help to understand the following error when
> running the websocket example.
>
> Context is :
>
> ERL 17
> Cowboy 2.0.0-pre (master)
> no source modification
>
>
> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't
> resolve the priv_dir of application
> websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>
> Thank you.
>
> Samir
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
--
St?phane Wirtel - http://wirtel.be - @matrixise
From samset at wanadoo.fr Thu Mar 19 18:31:23 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Thu, 19 Mar 2015 18:31:23 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
Message-ID: <[email protected]>
Manually from the application root dir.
with exec erl <paths>
Then starting all required applications
Not very clever i admit but could not print debug info with _rel/bin/websocket
Samir
> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>
> How do you run it?
>
> On 03/19/2015 06:08 PM, Samir Sow wrote:
>> Hi there,
>>
>> I would appreciate your help to understand the following error when running the websocket example.
>>
>> Context is :
>>
>> ERL 17
>> Cowboy 2.0.0-pre (master)
>> no source modification
>>
>>
>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>
>> Thank you.
>>
>> Samir
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
>>
>
> --
> Lo?c Hoguin
> http://ninenines.eu
From essen at ninenines.eu Thu Mar 19 18:40:00 2015
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 19 Mar 2015 18:40:00 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
If you don't use the release start script it can still work but you must
define ERL_LIBS to let Erlang know where applications are located (-pa
**ebin only says where *beams* are located).
Maybe more things.
On 03/19/2015 06:31 PM, Samir Sow wrote:
> Manually from the application root dir.
> with exec erl <paths>
> Then starting all required applications
>
> Not very clever i admit but could not print debug info with _rel/bin/websocket
>
> Samir
>
>
>> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>
>> How do you run it?
>>
>> On 03/19/2015 06:08 PM, Samir Sow wrote:
>>> Hi there,
>>>
>>> I would appreciate your help to understand the following error when running the websocket example.
>>>
>>> Context is :
>>>
>>> ERL 17
>>> Cowboy 2.0.0-pre (master)
>>> no source modification
>>>
>>>
>>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>>
>>> Thank you.
>>>
>>> Samir
>>> _______________________________________________
>>> Extend mailing list
>>> Extend at lists.ninenines.eu
>>> https://lists.ninenines.eu/listinfo/extend
>>>
>>
>> --
>> Lo?c Hoguin
>> http://ninenines.eu
>
--
Lo?c Hoguin
http://ninenines.eu
From samset at wanadoo.fr Thu Mar 19 18:46:38 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Thu, 19 Mar 2015 18:46:38 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
I?ve exported ERL_LIBS=<root_dir> before erl execution. but got same error ...
> On 19 mars 2015, at 18:40, Lo?c Hoguin <essen at ninenines.eu> wrote:
>
> If you don't use the release start script it can still work but you must define ERL_LIBS to let Erlang know where applications are located (-pa **ebin only says where *beams* are located).
>
> Maybe more things.
>
> On 03/19/2015 06:31 PM, Samir Sow wrote:
>> Manually from the application root dir.
>> with exec erl <paths>
>> Then starting all required applications
>>
>> Not very clever i admit but could not print debug info with _rel/bin/websocket
>>
>> Samir
>>
>>
>>> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>
>>> How do you run it?
>>>
>>> On 03/19/2015 06:08 PM, Samir Sow wrote:
>>>> Hi there,
>>>>
>>>> I would appreciate your help to understand the following error when running the websocket example.
>>>>
>>>> Context is :
>>>>
>>>> ERL 17
>>>> Cowboy 2.0.0-pre (master)
>>>> no source modification
>>>>
>>>>
>>>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>>>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>>>
>>>> Thank you.
>>>>
>>>> Samir
>>>> _______________________________________________
>>>> Extend mailing list
>>>> Extend at lists.ninenines.eu
>>>> https://lists.ninenines.eu/listinfo/extend
>>>>
>>>
>>> --
>>> Lo?c Hoguin
>>> http://ninenines.eu
>>
>
> --
> Lo?c Hoguin
> http://ninenines.eu
From essen at ninenines.eu Thu Mar 19 18:56:09 2015
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 19 Mar 2015 18:56:09 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
ERL_LIBS should point to the lib directory (where the application
directories are), not to the root directory of the release.
On 03/19/2015 06:46 PM, Samir Sow wrote:
> I?ve exported ERL_LIBS=<root_dir> before erl execution. but got same error ...
>
>
>> On 19 mars 2015, at 18:40, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>
>> If you don't use the release start script it can still work but you must define ERL_LIBS to let Erlang know where applications are located (-pa **ebin only says where *beams* are located).
>>
>> Maybe more things.
>>
>> On 03/19/2015 06:31 PM, Samir Sow wrote:
>>> Manually from the application root dir.
>>> with exec erl <paths>
>>> Then starting all required applications
>>>
>>> Not very clever i admit but could not print debug info with _rel/bin/websocket
>>>
>>> Samir
>>>
>>>
>>>> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>>
>>>> How do you run it?
>>>>
>>>> On 03/19/2015 06:08 PM, Samir Sow wrote:
>>>>> Hi there,
>>>>>
>>>>> I would appreciate your help to understand the following error when running the websocket example.
>>>>>
>>>>> Context is :
>>>>>
>>>>> ERL 17
>>>>> Cowboy 2.0.0-pre (master)
>>>>> no source modification
>>>>>
>>>>>
>>>>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>>>>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>>>>
>>>>> Thank you.
>>>>>
>>>>> Samir
>>>>> _______________________________________________
>>>>> Extend mailing list
>>>>> Extend at lists.ninenines.eu
>>>>> https://lists.ninenines.eu/listinfo/extend
>>>>>
>>>>
>>>> --
>>>> Lo?c Hoguin
>>>> http://ninenines.eu
>>>
>>
>> --
>> Lo?c Hoguin
>> http://ninenines.eu
>
--
Lo?c Hoguin
http://ninenines.eu
From samset at wanadoo.fr Thu Mar 19 19:01:38 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Thu, 19 Mar 2015 19:01:38 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
You mean where src, priv, ebin, deps ? are, right ?
Samir
> On 19 mars 2015, at 18:56, Lo?c Hoguin <essen at ninenines.eu> wrote:
>
> ERL_LIBS should point to the lib directory (where the application directories are), not to the root directory of the release.
>
> On 03/19/2015 06:46 PM, Samir Sow wrote:
>> I?ve exported ERL_LIBS=<root_dir> before erl execution. but got same error ...
>>
>>
>>> On 19 mars 2015, at 18:40, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>
>>> If you don't use the release start script it can still work but you must define ERL_LIBS to let Erlang know where applications are located (-pa **ebin only says where *beams* are located).
>>>
>>> Maybe more things.
>>>
>>> On 03/19/2015 06:31 PM, Samir Sow wrote:
>>>> Manually from the application root dir.
>>>> with exec erl <paths>
>>>> Then starting all required applications
>>>>
>>>> Not very clever i admit but could not print debug info with _rel/bin/websocket
>>>>
>>>> Samir
>>>>
>>>>
>>>>> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>>>
>>>>> How do you run it?
>>>>>
>>>>> On 03/19/2015 06:08 PM, Samir Sow wrote:
>>>>>> Hi there,
>>>>>>
>>>>>> I would appreciate your help to understand the following error when running the websocket example.
>>>>>>
>>>>>> Context is :
>>>>>>
>>>>>> ERL 17
>>>>>> Cowboy 2.0.0-pre (master)
>>>>>> no source modification
>>>>>>
>>>>>>
>>>>>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>>>>>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> Samir
>>>>>> _______________________________________________
>>>>>> Extend mailing list
>>>>>> Extend at lists.ninenines.eu
>>>>>> https://lists.ninenines.eu/listinfo/extend
>>>>>>
>>>>>
>>>>> --
>>>>> Lo?c Hoguin
>>>>> http://ninenines.eu
>>>>
>>>
>>> --
>>> Lo?c Hoguin
>>> http://ninenines.eu
>>
>
> --
> Lo?c Hoguin
> http://ninenines.eu
From essen at ninenines.eu Thu Mar 19 19:03:50 2015
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Thu, 19 Mar 2015 19:03:50 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
No. ERL_LIBS=_rel/hello_world_example/lib
Or, ERL_LIBS=..:deps if you want the non-release version. Beware of
what's in .. though (should be fine if you are in the examples folder).
On 03/19/2015 07:01 PM, Samir Sow wrote:
> You mean where src, priv, ebin, deps ? are, right ?
>
> Samir
>
>> On 19 mars 2015, at 18:56, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>
>> ERL_LIBS should point to the lib directory (where the application directories are), not to the root directory of the release.
>>
>> On 03/19/2015 06:46 PM, Samir Sow wrote:
>>> I?ve exported ERL_LIBS=<root_dir> before erl execution. but got same error ...
>>>
>>>
>>>> On 19 mars 2015, at 18:40, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>>
>>>> If you don't use the release start script it can still work but you must define ERL_LIBS to let Erlang know where applications are located (-pa **ebin only says where *beams* are located).
>>>>
>>>> Maybe more things.
>>>>
>>>> On 03/19/2015 06:31 PM, Samir Sow wrote:
>>>>> Manually from the application root dir.
>>>>> with exec erl <paths>
>>>>> Then starting all required applications
>>>>>
>>>>> Not very clever i admit but could not print debug info with _rel/bin/websocket
>>>>>
>>>>> Samir
>>>>>
>>>>>
>>>>>> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>>>>
>>>>>> How do you run it?
>>>>>>
>>>>>> On 03/19/2015 06:08 PM, Samir Sow wrote:
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I would appreciate your help to understand the following error when running the websocket example.
>>>>>>>
>>>>>>> Context is :
>>>>>>>
>>>>>>> ERL 17
>>>>>>> Cowboy 2.0.0-pre (master)
>>>>>>> no source modification
>>>>>>>
>>>>>>>
>>>>>>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>>>>>>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>>>>>>
>>>>>>> Thank you.
>>>>>>>
>>>>>>> Samir
>>>>>>> _______________________________________________
>>>>>>> Extend mailing list
>>>>>>> Extend at lists.ninenines.eu
>>>>>>> https://lists.ninenines.eu/listinfo/extend
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Lo?c Hoguin
>>>>>> http://ninenines.eu
>>>>>
>>>>
>>>> --
>>>> Lo?c Hoguin
>>>> http://ninenines.eu
>>>
>>
>> --
>> Lo?c Hoguin
>> http://ninenines.eu
>
--
Lo?c Hoguin
http://ninenines.eu
From samset at wanadoo.fr Thu Mar 19 19:32:11 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Thu, 19 Mar 2015 19:32:11 +0100
Subject: [99s-extend] cowboy websocket example runtime error
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
Message-ID: <[email protected]>
OK. The error is cleared.
Now i get a 404 on the client when trying to connect.
Thank you.
Samir
> On 19 mars 2015, at 19:03, Lo?c Hoguin <essen at ninenines.eu> wrote:
>
> No. ERL_LIBS=_rel/hello_world_example/lib
>
> Or, ERL_LIBS=..:deps if you want the non-release version. Beware of what's in .. though (should be fine if you are in the examples folder).
>
> On 03/19/2015 07:01 PM, Samir Sow wrote:
>> You mean where src, priv, ebin, deps ? are, right ?
>>
>> Samir
>>
>>> On 19 mars 2015, at 18:56, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>
>>> ERL_LIBS should point to the lib directory (where the application directories are), not to the root directory of the release.
>>>
>>> On 03/19/2015 06:46 PM, Samir Sow wrote:
>>>> I?ve exported ERL_LIBS=<root_dir> before erl execution. but got same error ...
>>>>
>>>>
>>>>> On 19 mars 2015, at 18:40, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>>>
>>>>> If you don't use the release start script it can still work but you must define ERL_LIBS to let Erlang know where applications are located (-pa **ebin only says where *beams* are located).
>>>>>
>>>>> Maybe more things.
>>>>>
>>>>> On 03/19/2015 06:31 PM, Samir Sow wrote:
>>>>>> Manually from the application root dir.
>>>>>> with exec erl <paths>
>>>>>> Then starting all required applications
>>>>>>
>>>>>> Not very clever i admit but could not print debug info with _rel/bin/websocket
>>>>>>
>>>>>> Samir
>>>>>>
>>>>>>
>>>>>>> On 19 mars 2015, at 18:10, Lo?c Hoguin <essen at ninenines.eu> wrote:
>>>>>>>
>>>>>>> How do you run it?
>>>>>>>
>>>>>>> On 03/19/2015 06:08 PM, Samir Sow wrote:
>>>>>>>> Hi there,
>>>>>>>>
>>>>>>>> I would appreciate your help to understand the following error when running the websocket example.
>>>>>>>>
>>>>>>>> Context is :
>>>>>>>>
>>>>>>>> ERL 17
>>>>>>>> Cowboy 2.0.0-pre (master)
>>>>>>>> no source modification
>>>>>>>>
>>>>>>>>
>>>>>>>> =ERROR REPORT==== 19-Mar-2015::18:04:36 ===
>>>>>>>> Error in process <0.160.0> with exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application websocket"}},{mfa,{cowboy_static,init,2}},{stacktrace,[{cowboy_static,priv_path,2,[{file,"src/cowboy_static.erl"},{line,66}]},{cowboy_static,init_opts,2,[{file?
>>>>>>>>
>>>>>>>> Thank you.
>>>>>>>>
>>>>>>>> Samir
>>>>>>>> _______________________________________________
>>>>>>>> Extend mailing list
>>>>>>>> Extend at lists.ninenines.eu
>>>>>>>> https://lists.ninenines.eu/listinfo/extend
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Lo?c Hoguin
>>>>>>> http://ninenines.eu
>>>>>>
>>>>>
>>>>> --
>>>>> Lo?c Hoguin
>>>>> http://ninenines.eu
>>>>
>>>
>>> --
>>> Lo?c Hoguin
>>> http://ninenines.eu
>>
>
> --
> Lo?c Hoguin
> http://ninenines.eu
From samset at wanadoo.fr Mon Mar 30 17:12:12 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Mon, 30 Mar 2015 17:12:12 +0200
Subject: [99s-extend] websocket handler
Message-ID: <[email protected]>
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
From essen at ninenines.eu Mon Mar 30 17:18:02 2015
From: essen at ninenines.eu (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=)
Date: Mon, 30 Mar 2015 17:18:02 +0200
Subject: [99s-extend] websocket handler
In-Reply-To: <[email protected]>
References: <[email protected]>
Message-ID: <[email protected]>
[<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
From samset at wanadoo.fr Mon Mar 30 17:24:09 2015
From: samset at wanadoo.fr (Samir Sow)
Date: Mon, 30 Mar 2015 17:24:09 +0200
Subject: [99s-extend] websocket handler
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
Message-ID: <[email protected]>
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