node.js - Heroku nodejs websocket server returning 503? -


this solved, can't mark own answer yet it's solved!

so i'm trying host nodejs server on heroku, server works fine when host local, problem whenever try connect using:

const ws = new websocket('ws://<myapp>.herokuapp.com'); 

i error in heroku logs:

heroku[router]: at=error code=h10 desc="app crashed" method=get path="/" host=<myapp>.herokuapp.com request_id=<request-id> fwd="<my-ip>" dyno= connect= service= status=503 bytes= protocol=http 

i have no clue how fix this, , can't find on google. if understands better do, please tell me i'm doing wrong. here server code btw:

const websocket = require('ws');  var port = process.env.port || 3000;  const wss = new websocket.server({ port: port });  console.log("listening on %d", port);  wss.on('connection', function connection(ws) {   ws.on('message', function incoming(message) {   console.log('received: %s', message); });  ws.send('something'); }); 

i've fixed somehow, recreated application (on heroku) , worked reason, pretty weird solved.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -