Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cowboy_static no export function service_available #849

Closed
weyenrooney opened this issue Jul 14, 2015 · 4 comments
Closed

cowboy_static no export function service_available #849

weyenrooney opened this issue Jul 14, 2015 · 4 comments

Comments

@weyenrooney
Copy link

when I debug cowboy I can't get correct result,I use Im() to debug it ,I found that cowboy_static no export callback function service_available.
fy kdq fp2 3usnd3 yac
the code line is 947 in cowboy_rest,like below:
call(Req, State=#state{handler=Handler, handler_state=HandlerState},
Callback) ->
case erlang:function_exported(Handler, Callback, 2) of
true ->
try
Handler:Callback(Req, HandlerState)
catch Class:Reason ->
error_terminate(Req, State, Class, Reason, Callback)
end;
false ->
no_call
end.
How can I resolve this?

@zhongwencool
Copy link

Maybe you should check your cowboy version:(
a lot of change after V2*

@essen
Copy link
Member

essen commented Jul 14, 2015

Not sure what your problem is? Can you paste the error? cowboy_static does not have service_available because it doesn't need it.

@weyenrooney
Copy link
Author

ok,maybe it is because of cowboy version.
The problem is that I try to debug websocket,but in chrome it return
WebSocket connection to 'ws://localhost:8080/' failed: Error during WebSocket handshake: Unexpected response code: 200
so I trace into cowboy I found that no callback function service_available and cowboy terminate immediately

@essen
Copy link
Member

essen commented Jul 25, 2015

If you get a 200 response, then it's most likely you trying to connect to a handler that does not do Websocket. In your last comment you mention ws://localhost:8080/ which corresponds to / and most likely is the page serving your site rather than the Websocket handler.

If I'm incorrect please reopen. :-)

@essen essen closed this as completed Jul 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants