I spent a while the other day figuring out how to get websockets working on heroku, so I thought I'd write it up.
First, Heroku doesn't actually support websockets, so you must use something like socket.io which can fallback to various long polling mechanisms.