Wykorzystanie WSS proxy za pomocą .htaccess


Dodaj w pliku .htaccess

 

RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:9002/$1  [P,L]

Lub dodanie bezpośrednio virtualhosta.

 

<VirtualHost *:443>
  ServerName ws.networkmanager.pl
  
  RewriteEngine on
  RewriteCond ${HTTP:Upgrade} websocket [NC]
  RewriteCond ${HTTP:Connection} upgrade [NC]
  RewriteRule .* "wss:/localhost:3000/$1" [P,L]
  
  ProxyPass / https://localhost:3000/
  ProxyPassReverse / https://localhost:3000/
  ProxyRequests off
</VirtualHost>

Dodaj komentarz