Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But I assumed that backend isn't connected to the client directly, it's connected to the proxy server, and the proxy server holds tcp connections to the clients, and of course can hold millions of them.


In this case, nginx is simply relaying data over an active connection on each. There is an open socket between the client and nginx, and nginx and the backend, for every WebSocket.

There is not a port limit issue, however, as nginx can create more than one connection to a local backend server using unix domain sockets. But the backend server has to then manage multiple open connections, as well, one for each WebSocket.


It is a problem if you for some reason cannot use unix sockets. For example if the application server is either running on a different machine or does not have any unix socket implementation.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: