Add an experimental transparent HTTP proxy #225
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the key
slirp/http-intercept
is provided thenHTTP CONNECT
This has the advantage that the client doesn't need to know it's being proxied or the address of the proxy, so that if the client moves on the network everything continues to work.
Note that normally a client knows that it is talking to a proxy and sends slightly different requests: in particular it will use an absolute URI for the resource (e.g.
GET http://dave.recoil.org/
rather thanGET /
) and it will expect the proxy to behave like a proxy. Since we are trying to pretend we don't exist we try to be as transparent as possible and only change the resource URI.This PR works for simple cases such as
apk update
and plaincurl
/wget
. Test cases are provided which compare the proxied request to the original.This PR currently doesn't handle exclusions: we need to decide on the expressivity (e.g. wildcards and CIDRs)
Related to #20