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

proposal: x/net/websocket: Add proxy support #63205

Open
dmytro-i opened this issue Sep 25, 2023 · 2 comments
Open

proposal: x/net/websocket: Add proxy support #63205

dmytro-i opened this issue Sep 25, 2023 · 2 comments
Labels
Milestone

Comments

@dmytro-i
Copy link

dmytro-i commented Sep 25, 2023

I'd like to add proxy support to websocket.

In the client.go there is NewClient function which I think I need to change to add support for connection through proxy.
The way I see it is to add something along the lines of

	if (config.Proxy != nil) {
		err = newProxyConn(config.Proxy)
                if err != nil {
		    return
	        }
	}

before err = hybiClientHandshake(config, br, bw) call.
Function newProxyConn will basically send a CONNECT request to the proxy server and then websocket will proceed.
This of course will require Proxy to be added to Config struct.

This seems too easy to be true. I'm new to golang and probably missing something. All comments and suggestions are welcome.

@gopherbot gopherbot added this to the Proposal milestone Sep 25, 2023
@ianlancetaylor
Copy link
Contributor

Can you outline the user visible changes? Is it just a new Config.Proxy field? Thanks.

@dmytro-i
Copy link
Author

Yes, that should be it. I can try copying websocket source files into my project and playing with it to see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

3 participants