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

add proxy support to connect #105

Merged
merged 3 commits into from Oct 12, 2019
Merged

Conversation

enriquegh
Copy link
Contributor

fixes #54

Adds a new --proxy flag that will implement an https-proxy-agent and use the proxy specified.

Used this to test if my proxy could handle WebSocket connections and worked like a charm.
Thought I'd do a PR for this since there was some interest at some point.

bin/wscat Outdated
@@ -145,6 +146,9 @@ program
'Enable slash commands for control frames ' +
'(/ping, /pong, /close [code [, reason]])'
)
.option(
'--proxy <[protocol://]host[:port]>',
'Use proxy on given port (--connect only).')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ideally specify that the proxy must be a HTTP/HTTPS proxy that support the CONNECT method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added that to the comment flag info.

package.json Outdated
@@ -19,6 +19,7 @@
"license": "MIT",
"dependencies": {
"commander": "~3.0.0",
"https-proxy-agent": "^2.2.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this does not work on Node.js >= 10.0.0, see TooTallNate/proxy-agents#73,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. We might need to wait until that gets merged in?
Unless you can think of a workaround?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should wait.

@lpinca
Copy link
Member

lpinca commented Oct 8, 2019

@enriquegh https-proxy-agent@3.0.0 has been released.

@enriquegh
Copy link
Contributor Author

@lpinca updated the https-proxy-agent version and verified it works on 10.9.0 and 10.16.3

@lpinca lpinca merged commit 6036792 into websockets:master Oct 12, 2019
@lpinca
Copy link
Member

lpinca commented Oct 12, 2019

Thank you.

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

Successfully merging this pull request may close these issues.

Proxy Support
2 participants