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

Websocket on Tomcat: Unexpected Response Code 200 #95

Closed
awsk1994 opened this issue Jul 26, 2016 · 3 comments
Closed

Websocket on Tomcat: Unexpected Response Code 200 #95

awsk1994 opened this issue Jul 26, 2016 · 3 comments

Comments

@awsk1994
Copy link

awsk1994 commented Jul 26, 2016

Hi,

I use jRuby and I have the dev environment working fine on Puma server, and websockets work fine. On production, however, the application is deployed on Tomcat using warble. The websocket client gives

Websocket connection to <server_ip:port> failed: Error during WebSocket handshake: unexpected response code: 200

In the server log, I could see the onOpen Being triggered, but the websocket connection is lost.

Can you please help me?

Thanks,
Alex

@jcoglan
Copy link
Collaborator

jcoglan commented Jul 27, 2016

If you're getting a 200 status, this suggests that this library is not being given direct access to the TCP stream so it can write its own response headers.

We only support servers that implement the rack.hijack API. Does Tomcat support that?

@awsk1994
Copy link
Author

I realize that this is the same issue as jruby/jruby-rack#167

Thank you so much for the help.

@spalenza
Copy link

spalenza commented Jun 5, 2017

Hello @awsk1994, how are you?

Can you use jruby, faye-websocket and warble? I created a war with warble but when I try connect with jetty I receive this message.

var scheme   = "ws://";
var uri = scheme + window.document.location.host;
var ws = new WebSocket(uri);

// WebSocket connection to 'ws://localhost:8080/' failed: Error during WebSocket handshake: Unexpected response code: 500

I think that I need some jetty configurations when I will create a war. But, I don't know how add this configurations. Is it possible?

This is my issue in warbler gem: jruby/warbler#416

Thanks.

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