gpt4 book ai didi

websocket - 如何将在 dotcloud 上提供 websockets 的 Tornado 服务器暴露给 www?

转载 作者:行者123 更新时间:2023-12-01 06:39:25 26 4
gpt4 key购买 nike

我正在尝试安装 IPython html notebook server
在 dotCloud 上。 IPython 服务器使用 Tornado 和 websockets(以及在 tcp 套接字上使用 zeromq 的其他内部通信)。

这是我的 dotcloud.yml :

www:          
type: custom
buildscript: builder
ports:
nbserver: tcp

我正在遵循给定的自定义端口配方 herehere .如日志所示,我在 127.0.0.1:$DOTCLOUD_WWW_NBSERVER_PORT 上运行 Tornado 服务器:

/var/log/supervisor/www.log :

[NotebookApp] The IPython Notebook is running at: 'http://127.0.0.1:35928/'
[NotebookApp] Use Control-C to stop this server and shut down all kernels.



但是当我推送时,dotCloud CLI 告诉我:

WARNING: The service crashed at startup or is listening to the wrong port. It failed to >respond on port "nbserver" (42801) within 30 seconds. Please check the application logs.
...
Deployment finished. Your application is available at the following URLs No URL found. That's ok, it means that your application does not include a webservice."


my-app.dotcloud.com上什么都没有或 my-app.dotcloud.com:DOTCLOUD_WWW_NBSERVER_PORT
我在这里缺少什么?谢谢你的帮助。

更新

问题解决了。通常的 HTTP 端口与 websockets 配合良好,因此不需要自定义端口配方。这是我的新 dotcloud.yml :
www:
type: custom
buildscript: builder
ports:
web: http

与以下内容一起使用 ipython_notebook_config.py :
 c.NotebookApp.ip = '*'

这使得 tornado 网络服务器监听所有 IP 地址。

警告:首先设置安全性和身份验证!

Running a Public Notebook Server想要查询更多的信息。

最佳答案

真高兴你做到了!

将来,对于其他读者,您实际上希望您的应用收听 $PORT_NBSERVER然后在 DOTCLOUD_WWW_NBSERVER_PORT 上连接到它. $PORT_NBSERVER是本地端口,而后者是通过我们的路由/NAT 层暴露给外界的端口。

如果您有任何其他问题,请随时通过 http://support.dotcloud.com 与我们联系。

来源:我是 dotCloud 员工。

关于websocket - 如何将在 dotcloud 上提供 websockets 的 Tornado 服务器暴露给 www?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12266863/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com