Node.js http-proxy drops websocket requests

后端 未结 3 645
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 00:24

Okay, I\'ve spent over a week trying to figure this out to no avail, so if anyone has a clue, you are a hero. This isn\'t going to be an easy question to answer, unless I am

3条回答
  •  长发绾君心
    2020-12-30 01:00

    In general I don't think node is not the most used option as a proxy server, I, for one use nginx as a frontend server for node and it's a really great combination. Here are some instructions to install and use the nginx sticky sessions module.

    It's a lightweight frontend server with json like configuration, solid and very well tested.

    nginx is also a lot faster if you want to serve static pages, css. It's ideal to configure your caching headers, redirect traffic to multiple servers depending on domain, sticky sessions, compress css and javascript, etc.

    You could also consider a pure load balancing open source solution like HAProxy. In any case I don't believe node is the best tool for this, it's better to use it to implement your backend only and put something like nginx in front of it to handle the usual frontend server tasks.

提交回复
热议问题