Apache: Proxy websocket wss to ws

旧巷老猫 提交于 2020-01-03 13:34:33

问题


Does anyone know how can i proxy wss connection to ws?

For example:

ProxyPass "wss://" "ws://"


回答1:


The solution is to use rewrite rules:

 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]


来源:https://stackoverflow.com/questions/31211828/apache-proxy-websocket-wss-to-ws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!