gonzalocasas / node-proxy-middleware

proxy as middleware
MIT License
146 stars 65 forks source link

websockets support? #29

Open anarcher opened 9 years ago

anarcher commented 9 years ago

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.

drawveloper commented 9 years ago

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

orbitbot commented 9 years ago

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).

mousetree commented 9 years ago

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

orbitbot commented 9 years ago

@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.

kshaw commented 7 years ago

Anyone able to get websockets working?