<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE> [99s-extend] Problems with Bullet
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Problems%20with%20Bullet&In-Reply-To=%3C5162CF5F.2060200%40ninenines.eu%3E">
<META NAME="robots" CONTENT="index,nofollow">
<style type="text/css">
pre {
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
}
</style>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="000081.html">
<LINK REL="Next" HREF="000084.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[99s-extend] Problems with Bullet</H1>
<B>Loïc Hoguin</B>
<A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Problems%20with%20Bullet&In-Reply-To=%3C5162CF5F.2060200%40ninenines.eu%3E"
TITLE="[99s-extend] Problems with Bullet">essen at ninenines.eu
</A><BR>
<I>Mon Apr 8 16:08:31 CEST 2013</I>
<P><UL>
<LI>Previous message: <A HREF="000081.html">[99s-extend] Problems with Bullet
</A></li>
<LI>Next message: <A HREF="000084.html">[99s-extend] Problems with Bullet
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#82">[ date ]</a>
<a href="thread.html#82">[ thread ]</a>
<a href="subject.html#82">[ subject ]</a>
<a href="author.html#82">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Sounds like Bullet isn't in your path. Forgot -pa deps/*/ebin?
On 04/08/2013 03:53 PM, Lee Sylvester wrote:
><i> Hi all,
</I>><i>
</I>><i> 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 :-)
</I>><i>
</I>><i> Given the below handler:
</I>><i>
</I>><i> init(_Transport, Req, _Opts, _Active) ->
</I>><i> {ok, Req, undefined_state}.
</I>><i>
</I>><i> stream(Data, Req, State) ->
</I>><i> {ok, Req, State}.
</I>><i>
</I>><i> info(Info, Req, State) ->
</I>><i> {reply, Info, Req, State}.
</I>><i>
</I>><i> terminate(_Req, _State) ->
</I>><i> ok.
</I>><i>
</I>><i> Connecting with a websocket throws the following error:
</I>><i>
</I>><i> =ERROR REPORT==== 8-Apr-2013::14:46:11 ===
</I>><i> ** Cowboy handler bullet_handler terminating in init/3
</I>><i> for the reason error:undef
</I>><i> ** Options were [{handler,connection_handler}]
</I>><i> ** Request was [{socket,#Port<0.926>},
</I>><i> {transport,ranch_tcp},
</I>><i> {connection,keepalive},
</I>><i> {pid,<0.491.0>},
</I>><i> {method,<<"GET">>},
</I>><i> {version,{1,1}},
</I>><i> {peer,{{127,0,0,1},56630}},
</I>><i> {host,<<"localhost">>},
</I>><i> {host_info,undefined},
</I>><i> {port,8080},
</I>><i> {path,<<"/">>},
</I>><i> {path_info,undefined},
</I>><i> {qs,<<"encoding=text">>},
</I>><i> {qs_vals,undefined},
</I>><i> {fragment,<<>>},
</I>><i> {bindings,[]},
</I>><i> {headers,[{<<"upgrade">>,<<"websocket">>},
</I>><i> {<<"connection">>,<<"Upgrade">>},
</I>><i> {<<"host">>,<<"localhost:8080">>},
</I>><i> {<<"origin">>,<<"<A HREF="http://www.websocket.org">http://www.websocket.org</A>">>},
</I>><i> {<<"pragma">>,<<"no-cache">>},
</I>><i> {<<"cache-control">>,<<"no-cache">>},
</I>><i> {<<"sec-websocket-key">>,
</I>><i> <<"fEj/SOOcQgSKATOjhbNJBQ==">>},
</I>><i> {<<"sec-websocket-version">>,<<"13">>},
</I>><i> {<<"sec-websocket-extensions">>,
</I>><i> <<"x-webkit-deflate-frame">>}]},
</I>><i> {p_headers,[{<<"connection">>,[<<"upgrade">>]}]},
</I>><i> {cookies,undefined},
</I>><i> {meta,[]},
</I>><i> {body_state,waiting},
</I>><i> {multipart,undefined},
</I>><i> {buffer,<<>>},
</I>><i> {resp_compress,false},
</I>><i> {resp_state,waiting},
</I>><i> {resp_headers,[]},
</I>><i> {resp_body,<<>>},
</I>><i> {onresponse,undefined}]
</I>><i> ** Stacktrace: [{bullet_handler,init,
</I>><i> [{tcp,http},
</I>><i> {http_req,#Port<0.926>,ranch_tcp,keepalive,<0.491.0>,
</I>><i> <<"GET">>,
</I>><i> {1,1},
</I>><i> {{127,0,0,1},56630},
</I>><i> <<"localhost">>,undefined,8080,<<"/">>,
</I>><i> undefined,<<"encoding=text">>,undefined,<<>>,
</I>><i> [],
</I>><i> [{<<"upgrade">>,<<"websocket">>},
</I>><i> {<<"connection">>,<<"Upgrade">>},
</I>><i> {<<"host">>,<<"localhost:8080">>},
</I>><i> {<<"origin">>,<<"<A HREF="http://www.websocket.org">http://www.websocket.org</A>">>},
</I>><i> {<<"pragma">>,<<"no-cache">>},
</I>><i> {<<"cache-control">>,<<"no-cache">>},
</I>><i> {<<"sec-websocket-key">>,
</I>><i> <<"fEj/SOOcQgSKATOjhbNJBQ==">>},
</I>><i> {<<"sec-websocket-version">>,<<"13">>},
</I>><i> {<<"sec-websocket-extensions">>,
</I>><i> <<"x-webkit-deflate-frame">>}],
</I>><i> [{<<"connection">>,[<<"upgrade">>]}],
</I>><i> undefined,[],waiting,undefined,<<>>,false,waiting,[],
</I>><i> <<>>,undefined},
</I>><i> [{handler,connection_handler}]],
</I>><i> []},
</I>><i> {cowboy_handler,handler_init,4,
</I>><i> [{file,"src/cowboy_handler.erl"},{line,69}]},
</I>><i> {cowboy_protocol,execute,4,
</I>><i> [{file,"src/cowboy_protocol.erl"},{line,514}]}]
</I>><i>
</I>><i> 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.
</I>><i>
</I>><i> Thanks,
</I>><i> Lee
</I>><i> _______________________________________________
</I>><i> Extend mailing list
</I>><i> <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A>
</I>><i> <A HREF="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</A>
</I>><i>
</I>
--
Loïc Hoguin
Erlang Cowboy
Nine Nines
<A HREF="http://ninenines.eu">http://ninenines.eu</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="000081.html">[99s-extend] Problems with Bullet
</A></li>
<LI>Next message: <A HREF="000084.html">[99s-extend] Problems with Bullet
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#82">[ date ]</a>
<a href="thread.html#82">[ thread ]</a>
<a href="subject.html#82">[ subject ]</a>
<a href="author.html#82">[ author ]</a>
</LI>
</UL>
<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>