【发布时间】:2017-06-01 02:22:24
【问题描述】:
据我从有关 SE 的其他问题中了解到,在 Heroku 应用程序中无法使用多个端口,因为 Heroku 会为端口分配一个环境变量。
有没有推荐的解决方法?我见过一些使用带有子域的代理模块:
Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them?
但是,在这篇文章中:
How to create a subsubdomain for an app on heroku: (e.g. sub.myapp.herokuapp.com)
这表示 Heroku 中不再有子域。
在我的应用程序中,我目前正在使用 express 提供我的内容,并且有一个 websocket 服务器用于同步一些实时内容,两者都需要一个端口。我的问题是,在 heroku 中是否可以使用子域,以及为需要多个端口的 Web 应用程序提供服务的推荐方式是什么?
【问题讨论】:
标签: node.js heroku port reverse-proxy