Melvin MK #1

Hi, I’m running CyberPanel on a Hetzner VPS and trying to connect a Node.js WebSocket server running on port 3001.
I’m using:

  • CyberPanel (OpenLiteSpeed)
  • Node.js WebSocket server running on 127.0.0.1:3001

I added below in the Vhost config

extprocessor webmep {
type proxy
address 127.0.0.1:3001
maxConns 100
initTimeout 60
retryTimeout 0
respBuffer 0
protocol websocket
}

context /ws/ {
type proxy
handler webmep
uri /ws/
}

It is always giving me error backend uril [/ws/] not found when i checked the error logs of cyber panel

The WebSocket always fails with this error:

HTTP/2 426 Upgrade Required
or sometimes:
HTTP/1.1 400 Bad Request

I also tried adding .htaccess rules like:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule ^(.*)$ ws://127.0.0.1:3001/$1 [P,L]

How to solve this ??