0
opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.Flag("headless", true))
if ip != "" {
   opts = append(opts, chromedp.ProxyServer(ip))
}
alloctx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
defer cancel()
ctx, cancel := chromedp.NewContext(alloctx,
   chromedp.WithLogf(log.Printf),
)

It can proxy normally in mac, but it reports an error in linux Tip: page load error net::ERR_TIMED_OUT With proxy ip

1 Answers1

0

It's most likely that the server, on which your app is running (since you use call chromedp.NewExecAllocator, it's the same server where the browser is running), can not connect to the proxy. Please check the network connectivity between the server and the proxy.

If you believe that there is nothing wrong with the network, please provide a full demo to show the issue. It would be helpful to describe how the proxy is setup, so that others can reproduce the issue.

Zeke Lu
  • 6,349
  • 1
  • 17
  • 23