替代 http 端口?
我想用 C++ 编写一个浏览器聊天并编写一个自己的服务器,因为您无法使用 php 和其他语言在不同实例(聊天用户)之间发送文本。 我的 apache 使用端口 80 运行,这就是为什么我无法在端口 80 上运行“聊天 http 服务器”。如果某个浏览器不使用端口 80,某些浏览器会阻止与 http 站点的连接。 有人知道,我应该为这个小型服务器使用哪个端口以获得最佳浏览器兼容性?也许8080?我也可以购买不同的 IP 以在 :80 下运行它,但我的主机想要每月 5 欧元购买新 IP...
谢谢。
I want to write a browser-chat and write an own server in c++, because you can not send text between the different instances (chat user) in php and other languages.
I have apache running with port 80 and that's why I cant run the "chat http server" on port 80. Some browsers block connection to a http site if it does not use port 80.
Does someone knows, what port I should use for this small server for best browser compatibility? Maybe 8080? I could also buy a different IP to run it under :80, but my host wants 5€ per month for a new ip...
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 mod_proxy(或 mod_proxy_balancer)将 Apache 站点的某个分支上的请求转发到在其他端口上侦听 localhost 的其他 Web 服务器。
You can use mod_proxy (or mod_proxy_balancer) to forward requests on some branch of your Apache site to the other web server that listens to localhost on some other port.
使用主机名对应用程序进行分区 - 即
www.foo.bar:80
和chat.foo.bar:80
?Use hostname to partition your application --i.e.,
www.foo.bar:80
andchat.foo.bar:80
?除了端口 80 之外,端口 443(通常是 https)最常被允许通过各种防火墙进行出站连接。
Besides port 80, port 443 (normally https) is most common to be allowed for outbound connections through various firewalls.
您可以在 Apache mod_chat 或其他东西中编写您的站点。通过这种方式,您可以将所有基本的 HTTP 内容保存到 Apache,并可以利用 C++ 的全部功能专注于您的应用程序。
You could write your site in a Apache mod_chat or something. This way you keep all the basic HTTP stuff to Apache and can concentrate on your application will the full power of C++.