Hi,
for Erlang 17 & 18 use current HEAD
for anything below use legacy branch or v0.8.x releases



On Wed, Nov 18, 2015 at 9:41 PM, Mert Öztürk <[email protected]>
wrote:

> Hello,
>
> May i know which version of CB should i use and which erlang version?
> I came up here from the past conversation (
> https://groups.google.com/forum/#!msg/chicagoboss/-W4cOraeHvU/Rk-g6Mp-GSIJ)
> and saw that this is implemented almost 2 years ago.
>
> https://github.com/ChicagoBoss/ChicagoBoss/commit/c1bdf0223cca63f5a1f2344144116cbb1865ea19
> Now i check my boss files (api-websocket.html, boss_mochicow_handler and
> boss_service_worker) they are the same as modified, and still cant get my
> hostname from my myapp_service_websocket.erl while handle_join function
> with Req:header(host)
> If i know the version of min CB version and erlang version and also how to
> implement this, i can make it.
>
> Thanks
> Mert
>
> 18 Kasım 2015 Çarşamba 21:04:11 UTC+2 tarihinde Dmitry Polyanovsky yazdı:
>
>> Hi,
>>
>> try to use latest HEAD. windows is not something I can test, but we could
>> solve it too, if there is any problem.
>>
>> On Wednesday, November 18, 2015 at 3:09:22 PM UTC+2, Mert Öztürk wrote:
>>>
>>> Hello Dimitry
>>>
>>> Actually after your question, i realized that i am using an old version
>>> of CB and decided to upgrade OTP 17 to 18 and CB to the latest alpha
>>> release in the given link below;
>>> https://github.com/ChicagoBoss/ChicagoBoss/releases/tag/v0.9.pre-alpha-2
>>> When i try start-server.bat after creating a new project, it stays
>>> forever while ==>boss (compile)
>>> I am using windows 10. Is it about the OTP 18?
>>>
>>> Thanks
>>> Mert
>>>
>>> 18 Kasım 2015 Çarşamba 13:31:36 UTC+2 tarihinde Dmitry Polyanovsky yazdı:
>>>>
>>>> Hi,
>>>>
>>>> first of all, which CB version you are using?
>>>>
>>>> On Wednesday, November 18, 2015 at 12:21:51 PM UTC+2, Mert Öztürk wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I am trying to get hostname with websocket connection on the following
>>>>> function: handle_join(ServiceName, WebSocketId, State)
>>>>> I tried with
>>>>>  Req:header(host), Req:header(hostname), Req:header("host"), 
>>>>> Req:header("hostname"),
>>>>> but i get the following error;
>>>>>
>>>>> tt_service_websocket (<0.1698.0>) starting...
>>>>> 12:01:52.853 [error] ** Boss Service Handler tt_service_websocket
>>>>> terminating in join/0
>>>>>    for the reason error:undef
>>>>> ServiceUrl: "/websocket/service"
>>>>> WebSocketId: <0.1696.0>
>>>>> SessionId  : undefined
>>>>> State    :
>>>>> {state,{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}}}
>>>>> ** Stacktrace:
>>>>> [{http_req,header,[host,{http_req,#Port<0.39188>,ranch_tcp,keepalive,<0.1696.0>,<<"GET">>,'HTTP/1.1',{{127,0,0,1},52131},<<"localhost">>,undefined,8001,<<"/websocket/service">>,undefined,<<>>,undefined,[],[{<<"host">>,<<"localhost:8001">>},{<<"connection">>,<<"Upgrade">>},{<<"pragma">>,<<"no-cache">>},{<<"cache-control">>,<<"no-cache">>},{<<"upgrade">>,<<"websocket">>},{<<"origin">>,<<"
>>>>> http://localhost:8001";>>},{<<"sec-websocket-version">>,<<"13">>},{<<"user-agent">>,<<"Mozilla/5.0
>>>>> (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
>>>>> Chrome/46.0.2490.80 Safari/537.36">>},{<<"accept-encoding">>,<<"gzip,
>>>>> deflate,
>>>>> sdch">>},{<<"accept-language">>,<<"en-US,en;q=0.8">>},{<<"cookie">>,<<"_ga=GA1.1.93174808.1447451951">>},{<<"sec-websocket-key">>,<<"olKXNasMxISW/Xn6fPZ9Yg==">>},{<<"sec-websocket-extensions">>,<<"permessage-deflate;
>>>>> client_max_window_bits">>}],[{<<"sec-websocket-extensions">>,[{<<"permessage-deflate">>,[<<"client_max_window_bits">>]}]},{<<"upgrade">>,[<<"websocket">>]},{<<"connection">>,[<<"upgrade">>]}],undefined,[{websocket_compress,false},{websocket_version,13}],waiting,undefined,<<>>,false,waiting,[],<<>>,undefined}],[]},{tt_service_websocket,handle_join,4,[{file,"c:/Users/Asus/Desktop/tt/src/websocket/tt_service_websocket.erl"},{line,23}]},{boss_service_worker,handle_cast,2,[{file,"src/boss/boss_service_worker.erl"},{line,123}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,599}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]
>>>>>
>>>>> 12:01:52.853 [error] gen_server tt_service_websocket terminated with
>>>>> reason: bad return value: ok
>>>>> 12:01:52.853 [error] CRASH REPORT Process <0.1686.0> with 0 neighbours
>>>>> exited with reason: bad return value: ok in gen_server:terminate/6 line 
>>>>> 737
>>>>> 12:01:52.853 [error] Supervisor {global,boss_service_sup} had child
>>>>> tt_service_websocket started with
>>>>> boss_service_worker:start_link(tt_service_websocket,
>>>>> <<"/websocket/service">>) at <0.1686.0> exit with reason bad return value:
>>>>> ok in context child_terminated
>>>>>
>>>>> I think i get the cowboy req object in the error code. Is there a
>>>>> correct way to get hostname through websocket connection and use it in my
>>>>> websocket service code as a security and confirmation?
>>>>>
>>>>> Thanks
>>>>> Mert
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/1a0e1086-718d-4939-bcc5-03fc8cbd799a%40googlegroups.com
> <https://groups.google.com/d/msgid/chicagoboss/1a0e1086-718d-4939-bcc5-03fc8cbd799a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/CAF9GSxaNxo4dCY7W83JwAPgKSqtP7zTCW6CPC5V8%3Doongu40uA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to