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 --connect-to flag that allows to change dial target #905

Merged
merged 12 commits into from
Sep 12, 2024

Conversation

mmatczuk
Copy link
Contributor

Fixes #315

@Choraden
Copy link
Contributor

Choraden commented Sep 11, 2024

So a HostPort.Validate works differently than HostPortUser.Validate, which embeds HostPort 🤔 .
I guess, that's ok, since HostPortUser is used only in credentials (allows wildcards *).

@Choraden
Copy link
Contributor

How about adding an e2e test?

HTTP client options:
...
    --connect-to <HOST1:PORT1:HOST2:PORT2>,... (env FORWARDER_CONNECT_TO)
        For a request to the given HOST1:PORT1 pair, connect to HOST2:PORT2 instead. This option is suitable to direct
        requests at a specific server, e.g. at a specific cluster node in a cluster of servers. This option is only
        used to establish the network connection and does not work when request is routed using an upstream proxy. It
        does NOT affect the hostname/port that is used for TLS/SSL (e.g. SNI, certificate verification) or for the
        application protocols. HOST1 and PORT1 may be the empty string, meaning any host/port. HOST2 and PORT2 may
        also be the empty string, meaning use the request's original host/port.
Implement the following

"HOST1" and "PORT1" may be the empty string, meaning "any host/port".
"HOST2" and "PORT2" may also be the empty string, meaning "use the request's original host/port".
@mmatczuk
Copy link
Contributor Author

HostPortUser.Validate() now calls HostPort.Validate().
Added e2e test.

@mmatczuk mmatczuk force-pushed the mmt/connect_to_v2 branch 2 times, most recently from fa2a006 to 435401a Compare September 11, 2024 09:59
httpbin-1  | invalid argument "headers,api:errors" for "--log-http" flag: unknown name: apiError: failed to update flags
@mmatczuk mmatczuk merged commit 6cdeac0 into main Sep 12, 2024
6 checks passed
@mmatczuk mmatczuk deleted the mmt/connect_to_v2 branch September 12, 2024 10:04
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.

Add --connect-to flag like in curl
2 participants