public
Created

  • Download Gist
gistfile1.erl
Erlang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
SockjsState = sockjs_handler:init_state(<<"/socket">>,fun wsocket_handler/3, state, []),
VRoutes = [{[<<"socket">>, '...'], sockjs_cowboy_handler, SockjsState},
{'_', ?MODULE, []}],
Routes = [{'_', VRoutes}],
lager:info("Starting the cowboy listener on port ~p..~n",[?COWBOY_HTTP_PORT]),
cowboy:start_http(my_http_listener, ?COWBOY_HTTP_ACCEPTORS, [{port, ?COWBOY_HTTP_PORT}], [{dispatch, Routes}]).
 
Protoopts is [{dispatch,
[{'_',
[{[<<"socket">>,'...'],
sockjs_cowboy_handler,
{service,"/socket",
#Fun<example_sockjs_handler.0.96838682>,
[{callback,example_callback}],
"https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.min.js",
false,true,5000,25000,131072,
#Fun<sockjs_handler.0.32204701>}},
{'_',example_sockjs_handler,[]}]}]}]
 
2013-01-10 08:35:43.762 [debug] <0.729.0> Supervisor ranch_sup started ranch_listener_sup:start_link(my_http_listener, 100, ranch_tcp, [{port,9093}], cowboy_protocol, [{dispatch,[{'_',[{[<<"socket">>,'...'],sockjs_cowboy_handler,{service,"/socket",#Fun<example_so..>,...}},...]}]}]) at pid <0.781.0>
 
2013-01-10 08:35:54.672 [error] emulator Error in process <0.989.0> on node 'example@127.0.0.1' with exit value: {{badmatch,false},[{cowboy_router,execute,2,[{file,"src/cowboy_router.erl"},{line,37}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,467}]}]}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.