Skip to content

httpoverrpc: permit override of host-header in requests sent by the 'proxy' command. #598

Open
sfc-gh-jallie wants to merge 3 commits intomainfrom
jallie-proxy-cmd
Open

httpoverrpc: permit override of host-header in requests sent by the 'proxy' command. #598
sfc-gh-jallie wants to merge 3 commits intomainfrom
jallie-proxy-cmd

Conversation

@sfc-gh-jallie
Copy link
Collaborator

This PR contains a small change to the httpoverrpc proxy command to permit callers to specify a host-header to be set on requests received by the client proxy.

This simplifies a common pattern where proxy is used to tunnel requests to a host which normally expects to receive those requests over a public interface, and is expecting a particular host: value.

Without this change, callers were left with two bad options:

  1. Set --allow-any-host to true and --hostname to the expected 'host' value, and hope (or arrange) for the destination host to resolve this to localhost
  2. Temporarily override client DNS resolution to point the desired host to localhost, in order to send this traffic through the host proxy.

This fix, instead, affects only the request itself, and does not require the --allow-any-host flag or alterations to client DNS.

New tests have been added, in the pattern of the existing tests.

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.

2 participants