gpt4 book ai didi

Apache:代理 websocket wss 到 ws

转载 作者:行者123 更新时间:2023-12-04 20:38:21 26 4
gpt4 key购买 nike

有谁知道我如何将 wss 连接代理到 ws?

例如:

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

最佳答案

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

 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,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31211828/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com