Node.js http-proxy drops websocket requests

后端 未结 3 647
爱一瞬间的悲伤
爱一瞬间的悲伤 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 00:48

    I've been looking into something very similar to this myself, with the intent of generating (and destroying) Node.js cluster nodes on the fly.

    Disclaimer: I'd still not recommend doing this with Node; nginx is more stable for the sort of design architecture that you're looking for, or even more so, HAProxy (very mature, and easily supports sticky-session proxying). As @tsturzl indicates, there is satellite, but given the low volume of downloads, I'd tread carefully (at least in a production environment).

    That said, since you appear to have everything already set up with Node, rebuilding and re-architecting may be more work than it's worth. Therefore, to install the caronte branch with NPM:

    1. Remove your previous http-node-proxy Master installation with npm uninstall node-proxy and/or sudo npm -d uninstall node-proxy

    2. Download the caronte branch .zip and extract it.

    3. Run npm -g install /path/to/node-http-proxy-caronte
    4. In my case, the install linkage was broken, so I had to run sudo npm link http-proxy

    I've got it up and running using their basic proxy example -- whether or not this resolves your dropped sessions issue or not, only you will know.

提交回复
热议问题