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 optional method ProxyTLSConnection (closes #779) #782

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sleeyax
Copy link

@sleeyax sleeyax commented May 12, 2022

Previously, it was impossible to specify both Proxy and NetDialTLSContext on the websocket Dialer without experiencing connection issues. This commit brings a change to the proxy CONNECT flow so that the initial connection is always a normal proxy CONNECT over TCP, while allowing TLS customizations on the existing connection at a later point in time via the new ProxyTLSConnection method.

Fixes #779

Summary of Changes

Please see my comment on the relevant issue for a detailed explanation and my thought process: #779 (comment)

Tests are not included, I'd appreciate some help or guidance on that front because I'm unsure what to test, thanks!

Removed the call to NetDialTLSContext from the HTTP proxy CONNECT step and replaced it with a regular net.Dial in order to prevent connection issues. Custom TLS connections can now be made via the new optional ProxyTLSConnection method, after the proxy connection has been successfully established.
client.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[bug] Can't establish websocket connection when using NetDialTLSContext and Proxy together
4 participants