Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:proxy:lsws-as-a-websocket-proxy [2018/01/22 16:38]
Jackson Zhang [How to Configure LSWS as a WebSocket Proxy]
litespeed_wiki:proxy:lsws-as-a-websocket-proxy [2020/01/08 23:08]
qtwrk
Line 21: Line 21:
 {{ :​litespeed_wiki:​proxy:​add-websocket-proxy2-testfail.png?​600 |}} {{ :​litespeed_wiki:​proxy:​add-websocket-proxy2-testfail.png?​600 |}}
  
-===== How to Configure LSWS as a WebSocket Proxy =====+===== How to Configure LSWS Native Virtual Host as a WebSocket Proxy =====
 In the LSWS WebAdmin Console, navigate to **Virtual Host (Native) > General > Web Socket Proxy Setup** In the LSWS WebAdmin Console, navigate to **Virtual Host (Native) > General > Web Socket Proxy Setup**
  
Line 31: Line 31:
  
 Save and restart LSWS. Save and restart LSWS.
 +
 +===== How to Configure LSWS in cPanel as a WebSocket Proxy =====
 +
 +LSWS supports ''​ProxyPass''​ for WebSocket , e.g. 
 +
 +<​code>​ProxyPass / ws://​localhost:​3000/</​code>​
 +
 +This directive must be placed in apache vhost configuration file , not in .htaccess.
 +
 +Example for RocketChat , create below 2 files.
 +
 +''/​etc/​apache2/​conf.d/​userdata/​ssl/​2_4/​EXAMPLE/​www.example.com/​proxy.conf''​
 +
 +''/​etc/​apache2/​conf.d/​userdata/​std/​2_4/​EXAMPLE/​www.example.com/​proxy.conf''​
 +
 +replace ''​EXAMPLE''​ and ''​www.example.com''​ to the cPanel user and actual domain
 +
 +Add following code to both of them 
 +
 +<​code><​IfModule mod_rewrite.c>​
 +RewriteEngine on
 +RewriteRule (.*) http://​localhost:​3000/​$1 [P,L]
 +ProxyPass / ws://​localhost:​3000/​
 +</​IfModule></​code>​
 +
 +rebuild Apache configuration file and restart LSWS
 +
 +<​code>/​scripts/​buildhttpdconf
 +
 +/​usr/​local/​lsws/​bin/​lswsctrl restart</​code>​
 +
 +
 +
  
 ===== Final Test: The Front End ===== ===== Final Test: The Front End =====
  • Admin
  • Last modified: 2020/01/09 00:36
  • by Lisa Clarke