LiteSpeed/Apache WebSocket代理设置

kmbjn2e3  于 2023-06-29  发布在  Apache
关注(0)|答案(1)|浏览(117)

我有一个运行LiteSpeed的服务器,我正在使用Ratchet创建WebSocket服务器。之后,我按照以下指令LiteSpeed Websocket Proxy设置代理
它的工作原理,当我只有一个端口8080,但我想打开多个端口,设置多个服务器运行.我试过这样的东西

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^websocket$ http://sample:8080/ [P,L]
RewriteRule ^second$ http://sample:8081/ [P,L]
RewriteRule ^third$ http://sample:8082/ [P,L]
ProxyPass / ws://sample:8080/
ProxyPass / ws://sample:8081/
Proxypass / ws://sample:8082/
</IfModule>

我有三个WebSocket服务器运行在三个不同的端口。有没有人有一个想法呢?

6bc51xsx

6bc51xsx1#

我试过这个之后,它很有效

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^websocket$ http://sample:8080/ [P,L]
RewriteRule ^second$ http://sample:8081/ [P,L]
RewriteRule ^third$ http://sample:8082/ [P,L]
ProxyPass /ws ws://sample:8080/
ProxyPass /ws2 ws://sample:8081/
Proxypass /ws3 ws://sample:8082/
</IfModule>

相关问题