Skip to content

Conversation

@fhammerl
Copy link
Contributor

@fhammerl fhammerl commented Mar 1, 2023

Requests to localhost should not be proxied (if the proxy is on another device / network, the proxied request targeting 'localhost' will likely be lost)

The runner also ignores loopback IPs
Golang as well

@fhammerl fhammerl requested a review from a team as a code owner March 1, 2023 13:54
@fhammerl fhammerl changed the title Bypass proxy on loopback IPs Bypass proxy on loopback IPs (localhost, 127.*, ::1 etc) Mar 1, 2023
expect(res.message.statusCode).toBe(200)

// no support for ipv6 for now
expect(httpClient.get('http://[::1]:8091')).rejects.toThrow()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think this assertion is not relevant to this test case (we are testing the behaviour of proxy for loopback address). Maybe it could be moved into separate test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we don't support ipv6 in httpClient.get('http://[::1]:8091'). Once we do (aka httpClient.get no longer throws), I want this test to fail, because it means proxy bypass for ipv6 loopback adresses can now be tested and verified.

@fhammerl fhammerl merged commit 94ab8de into main Mar 6, 2023
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.

3 participants