titaniumnetwork-dev / Ultraviolet-Node-Archive

Highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers and more! Easy deployment version (Node.js)
https://ultravioletsw.dev
73 stars 910 forks source link

Websockets Do Not Close When Behind Nginx #43

Closed n1xxk closed 2 years ago

n1xxk commented 2 years ago

Notes

This is behind Nginx.

Expected Behavior

Websockets should close after the user ends their proxy session or closes their tab.

Current Behavior

The Websockets stay open resulting in very high Nginx CPU usage and also UV CPU usage.

Steps to Reproduce

  1. Make a websocket connecting through the proxy.
  2. Close it on the user side.
  3. UV is still connected to the remote server.

Context (Environment)

This makes my server very slow and shows 99% of UV CPU usage when it is doing nothing

Detailed Description

Please make a change when the user closes the WS UV also closes it on the server side.

n1xxk commented 2 years ago

I think I have fixed it now, I added proxy_socket_keepalive to the Nginx config.