Gottox / socket.io-java-client

Socket.IO Client Implementation in Java
MIT License
949 stars 387 forks source link

Not working with server deployed in heroku #86

Open jgato opened 10 years ago

jgato commented 10 years ago

I have a Socket.io (0.9.16) server implemented with node.js.

If I run the server locally, using the java client I can connect without problems. But, when I deploy the server in heroku the java client cannot connect, actually I cannot even see any log.

This is the error that heroku is logging:

2014-04-11T10:04:07.564942+00:00 heroku[router]: at=error code=H23 desc="Endpoint misconfigured" method=GET path=/socket.io/1/websocket/8bkprQT8GvPue3nlNdmN host=lcb-sub.herokuapp.com request_id=aeddd606-142d-4462-a36d-93862ed39fd6 fwd="81.44.82.222" dyno= connect= service= status=503 bytes=

kscc25 commented 10 years ago

Heroku currently only supports Websocket with XHR Polling, add this configuration in your server:

io.configure(function () {
  io.set("transports", ["xhr-polling"]);
  io.set("polling duration", 10);
});

Also, don't forget to enable Websocket for your app:

heroku labs:enable websockets -a appname

Unfortunately, I've tested and this library doesn't work properly as my issue submitted here.

jgato commented 10 years ago

ummmm... it seems estrange, because I can use websocket transport if the client is build in node.js. So it seems a problem of how this library try to make the connection. Forcing to use xhr-polling make it works with that library, but.... estrange/unexpected behaviour...