Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a proxy #690

Closed
ghost opened this issue Feb 25, 2016 · 2 comments
Closed

Setting a proxy #690

ghost opened this issue Feb 25, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 25, 2016

Hello,

Sorry if I'm duplicating an issue, but I could not find something similar. I need to create a web socket that uses an HTTP proxy. I tweaked the WebSocket.js file directly with no success. Some non-authoritative sources I found said the way to do it was in the requestOptions variable:

var requestOptions = { port: 8080, host: 'OUR_PROXY', headers: { 'Connection': 'Upgrade', 'Upgrade': 'websocket', 'Host': headerHost, 'Sec-WebSocket-Version': options.value.protocolVersion, 'Sec-WebSocket-Key': key } };

We need this because we're behind a corporate proxy we have no control over.
Any advice would be highly appreciated.

@alexjwong
Copy link

@Pimeau You can use the https-proxy-agent package (https://www.npmjs.com/package/https-proxy-agent) to route websocket requests through a proxy. (I just tried and succeeded through my corporate proxy).

Hope this helps.

@lpinca
Copy link
Member

lpinca commented Nov 13, 2016

Possible duplicate of #559.

@lpinca lpinca closed this as completed Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants