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
navigation failed: net::ERR_INVALID_AUTH_CREDENTIALS #994
Comments
Please fix the format of your markdown: 7 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] generated by check-issue |
用法的问题,create 里处理 auth |
如果改成在create中处理时则会报 panic: {-32000 Invalid state for continueInterceptedRequest }
|
如果在外围处理,需要处理每个 auth 事件,browser.MustHandleAuth 只处理碰到的第一个,你看看它的源代码就懂了 |
我在每个goroutine中做处理不可实现吗,或者如果在外围统一处理的话,我查到是使用EachEvent去控制全部活动,我改成这样,依旧报错 panic: {-32000 Invalid state for continueInterceptedRequest } go browser.EachEvent(func(e *proto.FetchAuthRequired) {
fakeAuth := &proto.FetchAuthChallengeResponse{
Response: proto.FetchAuthChallengeResponseResponseProvideCredentials,
Username: user,
Password: pwd,
}
err := proto.FetchContinueWithAuth{
RequestID: e.RequestID,
AuthChallengeResponse: fakeAuth,
}.Call(browser)
if err!=nil{
panic(err)
}
}, func(e *proto.FetchRequestPaused) {
err := proto.FetchContinueRequest{
RequestID: e.RequestID,
}.Call(browser)
if err!=nil{
panic(err)
}
})()
browsePool := rod.NewBrowserPool(20)
create := func() *rod.Browser {
return browser.MustIncognito()
}
// browser.MustPage() |
那你可能需要自己 debug 一下,应该是用法的问题,这方面 chromium cdp 缺少文档说明,只能猜测用法,让我来和让你来是一样的。 你这里报错的意思是 FetchContinueRequest 用法错误 |
我看了您另外的一个回答 #654 ,我感觉我和他的问题应该是差不多的,但是我这里使用了BrowserPool,所以我猜测是不是BrowserPool的问题,以下是我的完整代码,此时报错信息是 navigation failed: net::ERR_INVALID_AUTH_CREDENTIALS
|
I'm encountering this issue as well. Not sure what I'm doing wrong here. I have a proxy that doesn't return What would be the correct pattern? I know it's not proto.FetchAuthRequired, but I am struggling to find such a use-case in the docs. I tried using This code does not work:
|
following code is worked
browser.Page(proto.TargetCreateTarget{})
go browser.MustHandleAuth(username, password)() |
Switched my proxy provider and it worked. |
Thank you for your answer. This is indeed effective under normal requests, but it does not work in browser pools |
Rod Version: v0.114.5
我有一个隧道代理服务,支持http和https。他需要通过 http://user:pwd@ip:port 的形式通过验证,该服务测试过没有问题。
参照文档中 go browser.MustHandleAuth(user, pwd)() 成功设置了代理,并打开网站验证无误。但是同样的逻辑放在浏览器池browsePool中则报错,在创建browserPool之前设置browser.MustHandleAuth会报错 navigation failed: net::ERR_INVALID_AUTH_CREDENTIALS;创建后设置browser.MustHandleAuth则会报错 panic: {-32000 Invalid state for continueInterceptedRequest }。以下是我的代码
The text was updated successfully, but these errors were encountered: