-
-
Notifications
You must be signed in to change notification settings - Fork 369
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 issue #703
Comments
Please fix your markdown #322 |
@ysmood Please open |
Check the chromium doc: https://chromium.googlesource.com/chromium/src/+/HEAD/net/docs/proxy.md#SOCKSv5-proxy-scheme
Works fine to me if you don't use The example proxy is something like this |
A potential solution can be found here: #305 |
defer func() {
if cerr := recover(); cerr != nil {
fmt.Println(cerr)
fmt.Println(string(debug.Stack()))
}
}()
fmt.Printf("Proxy: %s", account.Proxy)
px, _ := url.Parse("socks5://" + account.ProxyUser + ":" + account.ProxyPass + "@" + account.Proxy) // auth
//px, _ := url.Parse("socks5://" + account.Proxy)
u := launcher.New().RemoteDebuggingPort(9222).Headless(false).MustLaunch()
browser := rod.New().ControlURL(u).MustConnect()
defer browser.MustClose()
page := stealth.MustPage(browser)
client := &http.Client{
Timeout: 1 * time.Minute,
Transport: &http.Transport{Proxy: http.ProxyURL(px)},
}
router := browser.HijackRequests()
router.MustAdd("*", func(ctx *rod.Hijack) {
err := ctx.LoadResponse(client, true)
if err != nil {
fmt.Println(err)
} else {
// You can get the response body and all from here
}
})
go router.Run()
page.HijackRequests()
page = browser.MustPage("http://www.httpbin.org/ip")
page.MustWaitIdle()
time.Sleep(500 * time.Second) Sorted |
Currently can't use a socks5 proxy with example code provided
Errors:
panic: write tcp 127.0.0.1:54724->127.0.0.1:54722: use of closed network connection
or sometimes:
panic: navigation failed: net::ERR_SOCKS_CONNECTION_FAILED
Rod Version: v0.109.3
Proxy works as:
The text was updated successfully, but these errors were encountered: