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