<!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=%3CB09B2F4B-4842-430D-A3AB-AC132B646E04%40gmail.com%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="000080.html">
<LINK REL="Next" HREF="000082.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[99s-extend] Problems with Bullet</H1>
<B>Lee Sylvester</B>
<A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Problems%20with%20Bullet&In-Reply-To=%3CB09B2F4B-4842-430D-A3AB-AC132B646E04%40gmail.com%3E"
TITLE="[99s-extend] Problems with Bullet">lee.sylvester at gmail.com
</A><BR>
<I>Mon Apr 8 15:53:38 CEST 2013</I>
<P><UL>
<LI>Previous message: <A HREF="000080.html">[99s-extend] Bullet connection
</A></li>
<LI>Next message: <A HREF="000082.html">[99s-extend] Problems with Bullet
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#81">[ date ]</a>
<a href="thread.html#81">[ thread ]</a>
<a href="subject.html#81">[ subject ]</a>
<a href="author.html#81">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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">>,<<"<A HREF="http://www.websocket.org">http://www.websocket.org</A>">>},
{<<"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">>,<<"<A HREF="http://www.websocket.org">http://www.websocket.org</A>">>},
{<<"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
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="000080.html">[99s-extend] Bullet connection
</A></li>
<LI>Next message: <A HREF="000082.html">[99s-extend] Problems with Bullet
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#81">[ date ]</a>
<a href="thread.html#81">[ thread ]</a>
<a href="subject.html#81">[ subject ]</a>
<a href="author.html#81">[ author ]</a>
</LI>
</UL>
<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>