3

I'm trying to establish a websocket connection on my heroku node server but keep getting the following error:

browser.js:13 WebSocket connection to 'ws://www.mywebsite.com/' failed: Error during WebSocket handshake: Unexpected response code: 503

Works great locally, but when I deploy it to heroku, it's a no go. I'm running a custom domain in front of my heroku instance and I'm wondering if the dns or something might be causing issues.

Anyone experience something similar?

Justin
  • 2,940
  • 3
  • 25
  • 43
  • Were you able to find a solution? I too am experiencing this on Heroku, not immediately but within the first few minutes of running my app. Works fine locally. – Alexander Tsepkov Jan 31 '17 at 10:51
  • In my case I was running a koa node server, and wasn't able to figure how to use websockets on that same server. Instead in my case I opened a new server on a different port. Unfortunately with heroku they only give you 1 open port thats randomly generated. So using another secondary port to accept websockets on heroku is a no go. I ended up using digtal ocean for the time being, until I can figure out how to combine the servers, and have it accept the 2 protocols at the same time. What server are you using? – Justin Feb 01 '17 at 14:32
  • I see, sounds like our issues are different then. I am indeed using Heroku, and I use websockets for PouchDB. I had to switch to a different plugin that allows to use the same port for both. At first it works fine, but seems to crash after a few mins. – Alexander Tsepkov Feb 01 '17 at 17:54
  • Ahh ok gotcha. Unfortunately no experience with pouchdb myself. Websockets seem frustrating to debug at times. Wish I was more help. Good luck! Let me know what you end up finding out. Could be helpful to others once you nail down the issue. – Justin Feb 02 '17 at 19:36

0 Answers0