[99s-extend] Problems with Bullet
Lee Sylvester
lee.sylvester at gmail.com
Mon Apr 8 16:21:53 CEST 2013
Thanks guys, that was exactly the problem. I feel a little stupid :-) I use Rebar to compile my apps, but none of the three books I have on Erlang describe the config files in much detail. I probably have my entire setup wrong.
Anyhow, it looks to be working, now :-)
Thanks again,
Lee
On 8 Apr 2013, at 15:18, "Phillips, Christopher" <Christopher.Phillips at turner.com> wrote:
> *facepalm* Or that, yeah. Should have correlated the stack trace with
> the error. Not used to seeing cowboy run as the app, not a dependency.
>
> On 4/8/13 10:08 AM, "Loïc Hoguin" <essen at ninenines.eu> wrote:
>
>> Sounds like Bullet isn't in your path. Forgot -pa deps/*/ebin?
>>
>> On 04/08/2013 03:53 PM, Lee Sylvester wrote:
>>> Hi all,
>>>
>>> I'm currently having problems getting a websocket to connect to a
>>> simple bare bones Bullet handler. Unfortunately, I'm still quite an
>>> Erlang noob, so the stack traces tend to lead me in circles. I'm hoping
>>> this is obvious stuff to you Erlang pros :-)
>>>
>>> Given the below handler:
>>>
>>> init(_Transport, Req, _Opts, _Active) ->
>>> {ok, Req, undefined_state}.
>>>
>>> stream(Data, Req, State) ->
>>> {ok, Req, State}.
>>>
>>> info(Info, Req, State) ->
>>> {reply, Info, Req, State}.
>>>
>>> terminate(_Req, _State) ->
>>> ok.
>>>
>>> Connecting with a websocket throws the following error:
>>>
>>> =ERROR REPORT==== 8-Apr-2013::14:46:11 ===
>>> ** Cowboy handler bullet_handler terminating in init/3
>>> for the reason error:undef
>>> ** Options were [{handler,connection_handler}]
>>> ** Request was [{socket,#Port<0.926>},
>>> {transport,ranch_tcp},
>>> {connection,keepalive},
>>> {pid,<0.491.0>},
>>> {method,<<"GET">>},
>>> {version,{1,1}},
>>> {peer,{{127,0,0,1},56630}},
>>> {host,<<"localhost">>},
>>> {host_info,undefined},
>>> {port,8080},
>>> {path,<<"/">>},
>>> {path_info,undefined},
>>> {qs,<<"encoding=text">>},
>>> {qs_vals,undefined},
>>> {fragment,<<>>},
>>> {bindings,[]},
>>> {headers,[{<<"upgrade">>,<<"websocket">>},
>>> {<<"connection">>,<<"Upgrade">>},
>>> {<<"host">>,<<"localhost:8080">>},
>>>
>>> {<<"origin">>,<<"http://www.websocket.org">>},
>>> {<<"pragma">>,<<"no-cache">>},
>>> {<<"cache-control">>,<<"no-cache">>},
>>> {<<"sec-websocket-key">>,
>>> <<"fEj/SOOcQgSKATOjhbNJBQ==">>},
>>> {<<"sec-websocket-version">>,<<"13">>},
>>> {<<"sec-websocket-extensions">>,
>>> <<"x-webkit-deflate-frame">>}]},
>>> {p_headers,[{<<"connection">>,[<<"upgrade">>]}]},
>>> {cookies,undefined},
>>> {meta,[]},
>>> {body_state,waiting},
>>> {multipart,undefined},
>>> {buffer,<<>>},
>>> {resp_compress,false},
>>> {resp_state,waiting},
>>> {resp_headers,[]},
>>> {resp_body,<<>>},
>>> {onresponse,undefined}]
>>> ** Stacktrace: [{bullet_handler,init,
>>> [{tcp,http},
>>>
>>> {http_req,#Port<0.926>,ranch_tcp,keepalive,<0.491.0>,
>>> <<"GET">>,
>>> {1,1},
>>> {{127,0,0,1},56630},
>>> <<"localhost">>,undefined,8080,<<"/">>,
>>> undefined,<<"encoding=text">>,undefined,<<>>,
>>> [],
>>> [{<<"upgrade">>,<<"websocket">>},
>>> {<<"connection">>,<<"Upgrade">>},
>>> {<<"host">>,<<"localhost:8080">>},
>>>
>>> {<<"origin">>,<<"http://www.websocket.org">>},
>>> {<<"pragma">>,<<"no-cache">>},
>>> {<<"cache-control">>,<<"no-cache">>},
>>> {<<"sec-websocket-key">>,
>>> <<"fEj/SOOcQgSKATOjhbNJBQ==">>},
>>> {<<"sec-websocket-version">>,<<"13">>},
>>> {<<"sec-websocket-extensions">>,
>>> <<"x-webkit-deflate-frame">>}],
>>> [{<<"connection">>,[<<"upgrade">>]}],
>>>
>>> undefined,[],waiting,undefined,<<>>,false,waiting,[],
>>> <<>>,undefined},
>>> [{handler,connection_handler}]],
>>> []},
>>> {cowboy_handler,handler_init,4,
>>> [{file,"src/cowboy_handler.erl"},{line,69}]},
>>> {cowboy_protocol,execute,4,
>>> [{file,"src/cowboy_protocol.erl"},{line,514}]}]
>>>
>>> Can anyone see what might be throwing this off? I'd like to get a
>>> minimal handler running before I attempt to add some logic.
>>>
>>> Thanks,
>>> Lee
>>> _______________________________________________
>>> Extend mailing list
>>> Extend at lists.ninenines.eu
>>> http://lists.ninenines.eu:81/listinfo/extend
>>>
>>
>>
>> --
>> Loïc Hoguin
>> Erlang Cowboy
>> Nine Nines
>> http://ninenines.eu
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> http://lists.ninenines.eu:81/listinfo/extend
>>
>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> http://lists.ninenines.eu:81/listinfo/extend
More information about the Extend
mailing list