I have a working websocket server running on heroku with a basic code.
var WebSocketServer = require("ws").Server var http = require("http"