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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -