Apache:将websocket代理从wss到ws [英] Apache: Proxy websocket wss to ws
本文介绍了Apache:将websocket代理从wss到ws的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道我如何代理与wss的wss连接吗?
Does anyone know how can i proxy wss connection to ws?
例如:
ProxyPass"wss://""ws://"
推荐答案
解决方案是使用重写规则:
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]
这篇关于Apache:将websocket代理从wss到ws的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文