<div dir="ltr">hello,<div><br></div><div style>  Using sockjs and the latest cowboy/ranch, I am running into a badarg error with cowboy_router.  Not sure what is causing this, i captured the debug info here in this gist </div>
<div style><br></div><div style><a href="https://gist.github.com/4502255">https://gist.github.com/4502255</a></div><div style><br></div><div style>I am starting like this </div><div style><br></div><div style><pre style="font-size:12px;line-height:1.4;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)">
<div class="" id="file-gistfile1-erl-LC1" style="padding-top:0px;padding-bottom:0px;padding-left:1em"><span class="" style="color:rgb(0,128,128)">SockjsState</span> <span class="" style="font-weight:bold">=</span> <span class="" style="color:rgb(85,85,85)">sockjs_handler</span><span class="">:</span><span class="" style="color:rgb(153,0,0);font-weight:bold">init_state</span><span class="">(</span><span class="" style="font-weight:bold"><<</span><span class="" style="color:rgb(221,17,68)">"/socket"</span><span class="" style="font-weight:bold">>></span><span class="">,</span><span class="" style="font-weight:bold">fun</span> <span class="">wsocket_handler</span><span class="" style="font-weight:bold">/</span><span class="" style="color:rgb(0,153,153)">3</span><span class="">,</span> <span class="">state</span><span class="">,</span> <span class="">[]),</span></div>
</pre><pre style="font-size:12px;line-height:1.4;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)"><div class="" id="file-gistfile1-erl-LC2" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
<span class="" style="color:rgb(0,128,128)">VRoutes</span> <span class="" style="font-weight:bold">=</span> <span class="">[{[</span><span class="" style="font-weight:bold"><<</span><span class="" style="color:rgb(221,17,68)">"socket"</span><span class="" style="font-weight:bold">>></span><span class="">,</span> <span class="">'...'</span><span class="">],</span> <span class="">sockjs_cowboy_handler</span><span class="">,</span> <span class="" style="color:rgb(0,128,128)">SockjsState</span><span class="">},</span></div>
</pre><pre style="font-size:12px;line-height:1.4;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)"><div class="" id="file-gistfile1-erl-LC3" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
                   <span class="">{</span><span class="">'_'</span><span class="">,</span> <span class="" style="font-weight:bold">?</span><span class="" style="color:rgb(0,128,128)">MODULE</span><span class="">,</span> <span class="">[]}],</span></div>
<div class="" id="file-gistfile1-erl-LC3" style="padding-top:0px;padding-bottom:0px;padding-left:1em"><span style="font-size:12px;line-height:1.4"> </span><span class="" style="font-size:12px;line-height:1.4;color:rgb(0,128,128)">Routes</span><span style="font-size:12px;line-height:1.4"> </span><span class="" style="font-size:12px;line-height:1.4;font-weight:bold">=</span><span style="font-size:12px;line-height:1.4"> </span><span class="" style="font-size:12px;line-height:1.4">[{</span><span class="" style="font-size:12px;line-height:1.4">'_'</span><span class="" style="font-size:12px;line-height:1.4">,</span><span style="font-size:12px;line-height:1.4">  </span><span class="" style="font-size:12px;line-height:1.4;color:rgb(0,128,128)">VRoutes</span><span class="" style="font-size:12px;line-height:1.4">}],</span></div>
</pre><pre style="font-size:12px;line-height:1.4;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)"><div class="" id="file-gistfile1-erl-LC5" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
 <span class="" style="color:rgb(85,85,85)">lager</span><span class="">:</span><span class="" style="color:rgb(153,0,0);font-weight:bold">info</span><span class="">(</span><span class="" style="color:rgb(221,17,68)">"Starting the cowboy listener on port </span><span class="" style="color:rgb(221,17,68)">~p</span><span class="" style="color:rgb(221,17,68)">..</span><span class="" style="color:rgb(221,17,68)">~n</span><span class="" style="color:rgb(221,17,68)">"</span><span class="">,[</span><span class="" style="font-weight:bold">?</span><span class="" style="color:rgb(0,128,128)">COWBOY_HTTP_PORT</span><span class="">]),</span></div>
</pre><pre style="font-size:12px;line-height:1.4;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:0px;margin-bottom:0px;padding:0px;color:rgb(0,0,0)"><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
 <span class="" style="color:rgb(85,85,85)">cowboy</span><span class="">:</span><span class="" style="color:rgb(153,0,0);font-weight:bold">start_http</span><span class="">(</span><span class="">my_http_listener</span><span class="">,</span> <span class="" style="font-weight:bold">?</span><span class="" style="color:rgb(0,128,128)">COWBOY_HTTP_ACCEPTORS</span><span class="">,</span> <span class="">[{</span><span class="">port</span><span class="">,</span> <span class="" style="font-weight:bold">?</span><span class="" style="color:rgb(0,128,128)">COWBOY_HTTP_PORT</span><span class="">}],</span> <span class="">[{</span><span class="">dispatch</span><span class="">,</span> <span class="" style="color:rgb(0,128,128)">Routes</span><span class="">}]).</span></div>
<div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em"><span class=""><br></span></div><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
<span class="">But the call to lists:keyfind(dispatch, 1, Env) seems to be failing for some reason.</span></div><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em"><span class=""><br>
</span></div><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em"><span class=""> Any ideas ?</span></div><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
<span class=""><br></span></div><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em"><span class=""> Thanks</span></div><div class="" id="file-gistfile1-erl-LC6" style="padding-top:0px;padding-bottom:0px;padding-left:1em">
<span class="">- AD</span></div></pre></div></div>