websocket未通过代理连接
我在centos7的websocket未通过代理连接,websocket,proxy,centos7,Websocket,Proxy,Centos7,我在centos7的/etc/apache/conf中以这种方式添加了代理 <VirtualHost *:443> ServerName mysitecom RewriteEngine On # When Upgrade:websocket header is present, redirect to ws # Using NC flag (case-insensitive) as some browsers will pass Websocket
/etc/apache/conf
中以这种方式添加了代理
<VirtualHost *:443>
ServerName mysitecom
RewriteEngine On
# When Upgrade:websocket header is present, redirect to ws
# Using NC flag (case-insensitive) as some browsers will pass Websocket
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule ^/ws/(.*) wss://mysitecom:3555/ws/$1 [P,L]
# All other requests go to http
ProxyPass "/" "http://mysitecom:3555/"
</VirtualHost>
我得到的错误是:websocket.js:82 websocket连接到'wss://mysitecom/socket.io/?EIO=4&transport=websocket
注意:3555端口已启用,我已检查它是否正在侦听
我哪里出错了?请纠正我
var sock = io("wss://mysitecom/ws/", {
transports: ['websocket']
});