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

Support http proxy correctly #939

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

Conversation

134130
Copy link

@134130 134130 commented Jun 20, 2024

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

  • Currently, the gorilla/websocket's HTTP Proxy implementation is only supports CONNECT proxy, which can be called as "Tunnel Proxy".
  • But there is another HTTP Proxy:
    • At the TCP level, the request is made to the Proxy address.
    • But the Host in the HTTP request is different.
  • �Typically, the HTTP_PROXY environment variable works as later one, and the HTTPS_PROXY environment variable works as "Tunnel Proxy".
  • I have referenced the golang's http/transport implementation: https://github.com/golang/go/blob/master/src/net/http/transport.go#L1744

Related Tickets & Documents

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Run verifications and test

  • make verify is passing
  • make test is passing

No Makefile I can find. I have tested with go test ./...
Also, I have wrote the integration tests like this: https://github.com/134130/websocket/blob/proxy-test/proxy_test.go

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 20, 2024
@134130
Copy link
Author

134130 commented Jun 24, 2024

I want to make another PR which closes #739 after this Pull Requests is merged.
@gorilla/pull-request-reviewers can you review this PR?

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

Successfully merging this pull request may close these issues.

Why does specifying the proxy address not work?
1 participant