Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Nodejs reverse proxy wss to ws on myw.pt direct admin web hosting
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nodejs reverse proxy wss to ws on myw.pt direct admin web hosting

comXyzcomXyz Member
edited December 2024 in Help

Anyone has experience hosting nodejs on direct admin cloudlinux please help me with this.
I'm trying to get a simple nodejs app working myw.pt direct admin shared hosting.

I set up a nodejs app, everything works well on ws:// connection. The problem is when expose the app, modern browsers only allow wss:// connection from https, I'm trying to reverse proxy wss to ws.

This is what chatgpt gave me, similar to what I found on internet.
I edit .htaccess file in public_html folder and add this code, it's not working.

RewriteEngine On

# WebSocket proxy
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^(.*)$ ws://localhost:3003/$1 [P,L]

# HTTP proxy
ProxyPass / http://localhost:3003/
ProxyPassReverse / http://localhost:3003/

Websocket handshake never finished, and stay at connecting state. Getting this error on browser console: "'WebSocket: Still in CONNECTING state."
Any ideas how to make it works?

Comments

Sign In or Register to comment.