سؤال

I'm experiencing a 503 error with heroku on my project using WebSockets and a custom domain.

WebSocket connection to 'ws://www.mydomain.com/shoutbox' failed: Error during WebSocket handshake: Unexpected response code: 503

Everything goes allright with adress ws://myapp.herokuapp.com/shoutbox. Everything is also good in my local setup.

Is there any cross-domain issue I'm not aware off ? I'm using play!2 as server side fwk, but I don't think there is any relation to this problem.

[EDIT] If I can only connect within my own domain then it would be fine. Cause this would be the address I'd like people to use.

هل كانت مفيدة؟

المحلول

I'm assuming you already enabled heroku labs:enable websockets since your herokuapp domain is working properly.

I have a hunch your DNS query is hitting a Heroku endpoint that doesn't support websockets, i.e. it's cached from before you enabled the websockets functionality.

If this behavior only happens on a single client, try flushing your DNS cache and trying again. Alternatively, make sure the DNS records for both of your domains are resolving to the same IP.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top