node-proxy-middleware icon indicating copy to clipboard operation
node-proxy-middleware copied to clipboard

websockets support?

Open anarcher opened this issue 10 years ago • 5 comments

Hello,

I really have fun with proxy-middleware. :-) I want to use websockets (like sockjs) with proxy-middleware. How can I use websockets with proxy-middleware?

Thanks.

anarcher avatar Jan 30 '15 03:01 anarcher

Nodejitsu's node-http-proxy implements websocket proxying. If you could add this feature as a PR, that would be awesome!

drawveloper avatar Mar 16 '15 22:03 drawveloper

FYI, I just set this up successfully with the simple example configuration proxying to a browser-sync development server. Browser-sync seems to be using Socket.IO internally, and I think it's falling back to the polling approach that Socket.IO supports if websockets are not directly available. Might be enough to solve some people's requirements (at least mine in this case).

orbitbot avatar Apr 23 '15 12:04 orbitbot

@orbitbot : can you paste a sample of your config?

mousetree avatar May 07 '15 15:05 mousetree

@mousetree Sure, relevant anonymized stuff: https://gist.github.com/orbitbot/3aff20b3ff625f5bffc5

Gulp is used to run Browser-sync as a development server (the default port is 3000 which explains the url in node) on a separate frontend repository, and then depending on configuration settings I'm either serving a login button or the proxied frontend.

orbitbot avatar May 08 '15 11:05 orbitbot

Anyone able to get websockets working?

kshaw avatar Jul 27 '17 22:07 kshaw