简体   繁体   English

Socketio和cloudflare

[英]Socketio and cloudflare

So I've already done my research and figured out that socket.io only works with cloudflare if you use set ports found that here 所以,我已经做了我的研究,并想通了,socket.io只有CloudFlare的工作,如果你使用发现,设置端口这里

So through that research I found that http and https can't use the same port. 因此,通过该研究,我发现http和https不能使用相同的端口。 I'm coming here to as you guys how do you get a socketio server to listen on two ports? 各位,我来这儿是如何获得一个socketio服务器来侦听两个端口的? So it can support http and https with cloudflare 因此它可以通过cloudflare支持http和https

The common method is referred to as an SSL Termination Proxy (also called SSL off-loading). 通用方法称为SSL终止代理(也称为SSL卸载)。 The proxy accepts incoming messages over HTTPS and passes the decrypted requests to another resource (another server, web service/API, etc.). 代理通过HTTPS接受传入消息,并将解密后的请求传递到另一个资源(另一个服务器,Web服务/ API等)。 This would allow your Node.js application utilizing socketio to handle all requests, no matter if the client made an HTTP or HTTPS request. 这将允许您的Node.js应用程序利用socketio处理所有请求,无论客户端是否发出HTTP或HTTPS请求。 Software like NGINX, Apache, and even Microsoft IIS are capable of providing this functionality. NGINX,Apache,甚至Microsoft IIS等软件都可以提供此功能。

Here are some links regarding this topic: 以下是有关此主题的一些链接:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM