Skip to content

Hope to add support for http proxy #34

Open
@xmbhjQAQ

Description

@xmbhjQAQ

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

Activity

creantan

creantan commented on Dec 8, 2022

@creantan

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

zh4n7wm commented on Dec 8, 2022

@zh4n7wm

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zh4n7wm@creantan@xmbhjQAQ

        Issue actions

          Hope to add support for http proxy · Issue #34 · m1guelpf/chatgpt-telegram