Deploying a TCP server to Heroku

前端 未结 2 1200
不思量自难忘°
不思量自难忘° 2021-02-10 09:47

I have a TCP server coded in node.js. I\'d like to put it up on Heroku because it\'s a free service and I don\'t need anything more than what their free plan offers.

Now

2条回答
  •  执笔经年
    2021-02-10 10:47

    Heroku doesn't support a generic TCP server but you should be able to get the functionality you want with socket.io.

    You need to put web in your Procfile. That's what lets Heroku bind an external connection to port 80 to the local port your web traffic will arrive you. You find that port by looking at the environment variable $PORT. More info, with examples, is here: https://devcenter.heroku.com/articles/nodejs

提交回复
热议问题