Apache:代理websocket wss到ws

时间:2015-07-03 17:28:56

标签: apache websocket wss

有谁知道如何代理与ws的wss连接?

例如:

  

ProxyPass“wss:// ”“ws://

1 个答案:

答案 0 :(得分:2)

解决方案是使用重写规则:

 RewriteEngine On
 RewriteCond %{HTTP:Upgrade} =websocket
 RewriteRule /(.*)           ws://localhost:9001/api/$1 [P,L]
 RewriteCond %{HTTP:Upgrade} !=websocket
 RewriteRule /(.*)           http://localhost:9001/api/$1 [P,L]