Totally pinched from the Heroku Example to validate running and deploying a websocket server on Heroku.
Check out the live demo or read the docs.
Godeps kind of suck but I got them there after a little luck.
End result was a websocket server that didn't really work on Heroku. Messages could not be read by server. The same code deployed to an instance on DigitalOcean worked well. I suspect interference from a proxy in Heroku world.
Bottom line is it doesn't work on Heroku, but it works well elsewhere.
See the play app run nicely on a DigitalOcean instance (only available during the Golang Meetup Talk)
- More investigation into Heroku fail needed.
- Put a proxy (e.g. HAProxy) in from of the websocket server on the DigitalOcean instance. I've seen this work in the past.
- Don't use Heroku for Websocket server? Sometimes free is only free if your time is worth nothing.
make deps
make run
Create a Heroku app if you haven't already.
heroku create -b heroku/go
Create the Redis addon.
heroku addons:create heroku-redis
Push the code to Heroku.
git push origin heroku
Open the app up in a browser.
heroku open
Push this to a server that isn't Heroku :)