Heroku websocket 连接 [英] Heroku websocket connection
问题描述
我正在构建一个在 heroku 默认服务级别上托管的应用程序,例如 my_app.herokuapp.com
应该打开一个 websocket.由于域是 https://
我必须使用 wss://
才能转发请求.
I'm building an app to be hosted on heroku default service level like my_app.herokuapp.com
which should open a websocket. Since domain is https://
I have to use wss://
in order to forward requests.
问题是3秒后连接失败
失败:连接建立错误:net::ERR_CONNECTION_CLOSED
failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED
在 SSL 端点文档页面中,我可以阅读
所有默认的 appname.herokuapp.com 域都已启用 SSL,并且可以通过使用https访问,例如,https://appname.herokuapp.com.
All default appname.herokuapp.com domains are already SSL-enabled and can be accessed by using https, for example, https://appname.herokuapp.com.
但是在 my_app
详细信息页面中有
but in my_app
detail page there is
SSL - 升级到付费 dynos 以配置 Heroku SSL
SSL - Upgrade to paid dynos to configure Heroku SSL
我闻到这可能是无法建立连接的原因,但由于这些句子似乎自相矛盾,我想更好地理解这个问题.
I smell this could be the reason why the connection cannot be established but since these sentences seems contradictory I would like to understand better the matter.
我认为由于我使用的是子域,因此启用了 SSL,但也许我需要升级到付费 dyno 才能对其进行配置.
I thought that since I'm using a subdomain the SSL is enabled but perhaps I need to upgrade to paid dyno in order to configurate it.
如果可以的话,我的解决方案是升级到业余爱好许可证(7 美元/月),以确保
If this can be the deal my solution would be to upgrade to hobby license (7$/month) which ensures the
自定义域的免费 SSL.
FREE SSL for custom Domains.
我是否遗漏了什么或者这可能是原因?
Am I missing something or this could be the reason?
推荐答案
根据 https://devcenter.heroku.com/articles/ssl:
任何使用付费 dynos 的应用程序都免费包含 Heroku SSL
Heroku SSL is included for free on any app that uses paid dynos
这是黄鼠狼的语言;除非您已经付费,否则它并不是真正免费的.
This is weasel language; it's not really free unless you're already paying for it.
这篇关于Heroku websocket 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!