Django Webfiction如何打开其他端口号?

2024-10-02 02:42:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我的服务器是运行django的webfiction。当前我需要添加即时消息到我的应用程序。所以我需要让服务器监听另一个端口号,比如9090,接受套接字连接。但是webfiction似乎只对开发者开放80个端口,那么如何在webfiction上打开其他端口号来实现简单的即时消息传递。[附加]我不想使用XMPP(openfire)或类似QuickBlox的东西,我只想实现自己的即时消息。。。在


Tags: django端口服务器应用程序xmpp开发者openfire端口号
2条回答

在Webfaction控制面板中,单击Domains/Websites -> Applications -> Add new application。在App category下拉列表中,选择Custom,然后在App type中选择Custom app (listening on port)。然后您应该看到以下文本(强调我的):

This installer assigns an unprivileged port on which custom software can listen.

This creates the ~/webapps// directory for your convenience; however, the custom application is not required to reside there.

After the installer has finished, configure your custom software to listen to the port number specified in the "port" field. If the application is configured in a website record, the front-end server proxies incoming requests at the specified URL to the assigned port.

Note: Custom applications are intended for handling HTTP traffic. If you need direct access to the port, please open a support ticket to request access to the assigned port.

Custom Applications documentation is available at: http://docs.webfaction.com/software/custom.html Website record documentation is available at: http://docs.webfaction.com/user-guide/websites.html

因此,您需要决定您的即时消息应用程序是通过HTTP进行通信还是通过直接访问端口进行通信,并相应地采取行动。为了简单起见,我假设您希望使用HTTP,但选择权取决于您。不过,一定要先通读custom applications documentation。这将是一个真正的自定义应用程序,因此您将需要编写逻辑来检查服务器是否仍在运行,如果需要,定期重新启动它,应用cron作业,随着负载的增加而增加运行的服务器实例的数量,等等

祝你好运!在

在文档上http://docs.webfaction.com/software/custom.html 如果你想要一个特定的端口,你需要开一张票:https://community.webfaction.com/questions/14771/open-custom-application-on-a-specific-port-to-serve-mongodb-httpd-for-simple-rest-interface

顺便说一句,webfiction有一个QA社区页面更适合这类问题https://community.webfaction.com/

相关问题 更多 >

    热门问题