Skip to content
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

Can anyone tell me how to send request through proxy? #74

Open
zhangyiming748 opened this issue Feb 11, 2022 · 2 comments
Open

Can anyone tell me how to send request through proxy? #74

zhangyiming748 opened this issue Feb 11, 2022 · 2 comments

Comments

@zhangyiming748
Copy link

I need to access a specific website through the native proxy port
thanks

@vidyasagarr7
Copy link

vidyasagarr7 commented Apr 3, 2022

I am looking for some inputs on this as well. Would be great if anyone can point to useful resources

@zhangyiming748
Copy link
Author

I am looking for some inputs on this as well. Would be great if anyone can point to useful resources

i changed this

func GetWithProxy(url, proxy string) (string, error) {
	// 如果需要代理验证,那么如下进行设置
	// 否则直接设置为url.Parse("http://127.0.0.1:8889")
	// url, err := url.Parse("http://username:[email protected]:8000")
	// u, err := netURL.Parse("http://127.0.0.1:8889")
	u, err := netURL.Parse(proxy)
	if err != nil {
		log.Fatal("parse url error: ", err)
	}
	l.Info.Printf("使用魔法..biu..主机: %v\n", u.Host)

	client := http.Client{
		Transport: &http.Transport{
			// 设置代理
			Proxy: http.ProxyURL(u),
		},
	}
	return GetWithClient(url, &client)
}

But I don't know how to sent merge request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants