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

Hope to add support for http proxy #34

Open
xmbhjQAQ opened this issue Dec 8, 2022 · 2 comments
Open

Hope to add support for http proxy #34

xmbhjQAQ opened this issue Dec 8, 2022 · 2 comments

Comments

@xmbhjQAQ
Copy link

xmbhjQAQ commented Dec 8, 2022

In some application environments, I can only connect to the telegram through the proxy. This means that the global proxy needs to be opened, which will affect the running of other programs

@creantan
Copy link

creantan commented Dec 8, 2022

url_i := url.URL{}
url_proxy, err := url_i.Parse("http://127.0.0.1:1087")
bot, err := tgbotapi.NewBotAPIWithClient(os.Getenv("TELEGRAM_TOKEN"), tgbotapi.APIEndpoint, &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(url_proxy)}})

@zh4n7wm
Copy link

zh4n7wm commented Dec 8, 2022

#38

This pull request support socks5 proxy

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

3 participants