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
--proxy failed for auth proxy #86
Comments
Standard Chrome CDP didn't support that type of proxy, so we should get a solution from async def handler(tab: AsyncTab):
async with tab.iter_fetch(
[{
'urlPattern': '*',
'requestStage': 'Request'
}],
handleAuthRequests=True,
) as f:
async for i in f:
print(i)
if i['method'] == 'Fetch.authRequired':
await f.continueWithAuth(
i,
'ProvideCredentials',
'username',
'password',
)
else:
await f.continueRequest(i) To filter those requests of proxy auth required, check the PS: Fetch context could not be used twice in the same tab. |
Or use gosthttps://github.com/ginuerzh/gost/blob/master/README_en.md gost -L 127.0.0.1:9999 -F http://xxx@xxx:a.com/ port-forwarding proxy for chrome, python3 -m ichrome --proxy=http://127.0.0.1:9999 |
import asyncio
from ichrome import AsyncChromeDaemon
async def main():
async with AsyncChromeDaemon(proxy='http://127.0.0.1:10800',
clear_after_shutdown=True,
headless=1) as cd:
async with cd.connect_tab() as tab:
await tab.pass_auth_proxy('user', 'pwd')
await tab.goto('http://httpbin.org/ip', timeout=2)
print(await tab.html)
asyncio.run(main()) |
Windows环境好像不支持 https 的 auth proxy |
没试 https 的代理, 实在不行就走 gost 转发算了, 折腾不动了 |
给个方法呗,我看看能不能补全。 |
啥方法啊... 上面的评论是我所有尝试的手段了.. |
我更正一下,可能是IPv6的auth proxy不支持,IPv4的auth proxy可以。因为我用得代理很特殊。 |
原生 chrome 命令行的 proxy 就只支持 http 不支持 https, 而且还不支持带 http basic auth 的, 更别说 ipv6 了, 用 gost 直接丢子进程里转发算了 |
Some proxy have the auth information like: http://username:password@host:port
The text was updated successfully, but these errors were encountered: