Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

support socks proxy #40

Open
th0mson opened this issue Dec 17, 2018 · 6 comments
Open

support socks proxy #40

th0mson opened this issue Dec 17, 2018 · 6 comments

Comments

@th0mson
Copy link

th0mson commented Dec 17, 2018

Hello
Is there support for http/socks proxy for telegram, which keys to use?
If not, could you implement it?

thx

@metalmatze
Copy link
Owner

I have not looked into http/socks for the Telegram bot. I'm not sure the upstream library supports this. github.com/tucnak/telebot

Maybe you can open an issue with them and link to this issue?

@mfominov
Copy link

u can use http_proxy/https_proxy env variable to user proxy.
don't forget to add no_proxy hosts:)

@hdhog
Copy link

hdhog commented Mar 9, 2019

gopkg.in/tucnak/telebot.v2 is supporting using custom http client

socks proxy

dialer, err := proxy.SOCKS5("tcp", "host:port", &proxy.Auth{User: "anon", Password:"anon"}, proxy.Direct)
if err != nil {
	t.Fatal("Error creating dialer, aborting.")
}

	
httpTransport := &http.Transport{}
httpClient := &http.Client{Transport: httpTransport}
httpTransport.Dial = dialer.Dial

bot, err := NewBot(Settings{Token: token, Client:httpClient})

@obsessionsys
Copy link

Dear Matthias Loibl,
Please advise are you going to add the SOCKS5 proxy functionality soon? This is in huge demand in Russia.

@scruplelesswizard
Copy link

@obsessionsys please feel free to submit a PR to add the functionality

@inotnako
Copy link

inotnako commented Feb 27, 2020

@obsessionsys please just use env variable HTTP_PROXY=socks5://<YOUR_URL_WITH_CREDS>

https://golang.org/pkg/net/http/#ProxyFromEnvironment

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

No branches or pull requests

7 participants