我正在使用网络套接字。在 apache 中,我可以通过在配置文件中执行以下设置来从 https 重定向到 http:
<VirtualHost *:443>
# Common SSL Config
ServerName ec2-13-52-248-221.us-west-1.compute.amazonaws.com
SSLEngine on
# wss redirects to working ws protocol
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
ProxyPass "/" "http://ec2-13-52-248-221.us-west-1.compute.amazonaws.com" retry=0 keepalive=On
</VirtualHost>
但相同的配置(如上)我更改如下
<VirtualHost *:443>
# Common SSL Config
ServerName ec2-13-52-248-221.us-west-1.compute.amazonaws.com
SSLEngine on
# wss redirects to working ws protocol
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
ProxyPass "/wss" "ws://ec2-13-52-248-221.us-west-1.compute.amazonaws.com:8080" retry=0 keepalive=On
</VirtualHost>
我无法从 wss 重定向到 ws
在 Wss 的情况下,我在发送请求时使用以下网址:
wss://ec2-13-52-248-221.us-west-1.compute.amazonaws.com:8080/wss