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
feat(proxy): unify local network proxy behavior #10719
Conversation
/cc @pavelfeldman Opening this as WIP. Need to look into FF behavior (and clean up a bit). Can you mark CQ1 so I can see if there are any platform-specific quirks (esp. w/ the non-CR browsers…looking at you WK)? Thanks! |
0fae359
to
8d342e2
Compare
Looks like the FF failures have to do with my test, and not PW impl. Looks like our
|
Looks like the issue is with trying to proxy the HTTPS/connect requests in proxyServer which originate from browser startup. |
Pushed a workaround in latest commit. (Skips rewriting some HTTPS requests FF requires for startup so we don't have to deal with MITMing them better just for the tests.) |
ea7801f
to
36ad482
Compare
tests/browsercontext-proxy.spec.ts
Outdated
} | ||
]) { | ||
it(`${params.description}`, async ({ platform, browserName, contextFactory, server, proxyServer }) => { | ||
it.fail(platform !== 'linux' && browserName === 'webkit' && additionalBypass && ['localhost', '127.0.0.1'].includes(params.target), 'WK fails to proxy 127.0.0.1 and localhost if additional bypasses are present'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, style: given the complexity of the fail predicate, I'd copy-paste this test 3 times instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, style: given the complexity of the fail predicate, I'd copy-paste this test 3 times instead.
@pavelfeldman how strong of a nit is this? Hehe
I found the more complex fail predicate much easier to read/maintain/edit than trying to find the subtle differences in the otherwise lots of setup in each of the cases.
Mind if I revert d307a87 before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how strong of a nit is this?
Not too strong, do it the way you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to merge as is if this is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pavelfeldman! Just reverted! Ready for a merge whenever assuming tests pass.
Fixed up the tests based on the CQ1 run. Ready for another run. (Ran all the proxy tests locally {macOS, Linux/Docker} x {headless, head full}. Don’t have a windows box to verifies this will pass now, but they should :) |
@mxschmitt Thanks for toggling the label. Looks like |
Seems like a temporary GitHub/NPM outage, I'd recommend to rebase. |
When configuring a proxy, Chromium requires a magic tokens to get some local network requests to go through the proxy. This has tripped up a few users, so we make the behavior default to the expected: proxy everything including the local requests. This matches the other vendors as well. NB: This can be disabled via `PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK=1` Supercedes: microsoft#8345 Fixes: microsoft#10631
This reverts commit d307a87.
0cef729
to
2f8aeb0
Compare
Thanks for the re-trigger! Everything passed on the rebase except one unrelated test (https://github.com/microsoft/playwright/runs/4464958397?check_suite_focus=true) So should be good to merge! 🎉 cc: @pavelfeldman |
When configuring a proxy, Chromium requires a magic tokens to get some
local network requests to go through the proxy. This has tripped up a
few users, so we make the behavior default to the expected: proxy
everything including the local requests. This matches the other vendors
as well.
NB: This can be disabled via
PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK=1
Supercedes: #8345
Fixes: #10631