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

HTTP Proxy support #176

Closed
martijnburgers opened this issue Apr 3, 2018 · 16 comments
Closed

HTTP Proxy support #176

martijnburgers opened this issue Apr 3, 2018 · 16 comments

Comments

@martijnburgers
Copy link

Is there in some way support for a HTTP Proxy or is it SOCKS only?

@martijnburgers
Copy link
Author

https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_proxy.html

only proxy empty and socks are implemented

@martijnburgers
Copy link
Author

doesn't work for HTTP proxies

@isopen
Copy link
Contributor

isopen commented Apr 3, 2018

http gradually fades into the past. But let's wait for the answers of professionals.

@FrayxRulez
Copy link
Contributor

Telegram clients usually connect via TCP directly, and HTTP isn’t used at all.

@martijnburgers
Copy link
Author

We use it as our proxy only supports HTTP. The Telegram Desktop client also supports it.

The log tells us this

[ 3][t 4][1522496564.618938208][Td.cpp:3933][!Td][&td_requests] Receive request 3: setProxy {
proxy = proxySocks5 {
server = "proxyserver.eu.localdomain.com"
port = 1080
username = ""
password = ""
}
}

[ 3][t 4][1522496564.618938208][ConfigManager.cpp:448][!Recoverer][&config_recoverer] Failed to connect for 0.002220
[ 3][t 4][1522496564.618938208][ConfigManager.cpp:507][!Recoverer][&config_recoverer] Wakeup in 20.0s
[ 3][t 4][1522496564.618938208][ConfigManager.cpp:342][!Recoverer][&config_recoverer] ON CONNECTING false
[ 3][t 4][1522496564.618938208][ConfigManager.cpp:450][!Recoverer][&config_recoverer] Successfully connected
[ 3][t 4][1522496564.618938208][ConfigManager.cpp:510][!Recoverer][&config_recoverer] Wakeup NEVER
[ 2][t 3][1522496564.618938208][Session.cpp:1079][!HandshakeActor] [Error : 0 : Cancelled : [xxx.xxx.xxx.xxx:443] DcId{1}[0.0.0.0:24285]]
[ 3][t 2][1522496564.619938374][IPAddress.cpp:151][!GetHostByNameActor] Try to init IP address of proxyserver.eu.localdomain.com with port 1080
[ 3][t 4][1522496564.619938374][Td.cpp:4648][!Td][&td_requests] Sending result for request 3: ok {
}

@isopen
Copy link
Contributor

isopen commented Apr 3, 2018

See how it is implemented in Telegram Desktop https://github.com/telegramdesktop/tdesktop

@FrayxRulez
Copy link
Contributor

Telegram APIs support HTTP protocol, but this usually considered a fallback whether standard TCP connections can’t be used, and not all the clients support it: afaik only TDesktop, iOS and Windows Phone apps support it, and only TDesktop offers the possibility to use a HTTP proxy.

So, tl;dr: TDLib doesn’t support connecting to Telegram servers via HTTP, so you can’t connect to Telegram servers through an HTTP proxy. If you want to use a proxy, at the moment, you must use a SOCKS5 proxy.
I have no idea if connecting through HTTP will be implemented in the future, but if they’ll implement this they’ll probably allow you to use a HTTP proxy as well.

@levlam
Copy link
Contributor

levlam commented Apr 3, 2018

TDLib doesn't support HTTP proxy at the moment, but setProxy method was designed to easily add HTTP-proxy support in the future. HTTP protocol is also supported by TDLib, so HTTP proxy support wasn't implemented just because it isn't needed by main clients based on TDLib.

@isopen
Copy link
Contributor

isopen commented Apr 4, 2018

Preston is to blame. He wrote too many cycles.

@JunaidBabu
Copy link

If you're using tdlib with Python on Linux, you can use proxychains to connect through HTTP Proxy

@tejasvi8874
Copy link

My College Wi-Fi uses HTTP proxy with authentication. I was looking towards Telegram as a WhatsApp alternative but only Telegram UWP supports it currently.

@levlam
Copy link
Contributor

levlam commented Sep 5, 2018

HTTP proxy support was added to TDLib 1.3.0.

@mfat
Copy link

mfat commented May 4, 2019

Also Telegram X supports http proxy.

@LinuxCuba
Copy link

Please add support for windows auth session with auto-detect system proxy by kerberos auth proxy. Testing telegram in windows 10 not connect, because not detect kerberos mechanism of authentication.

Thanks.

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

No branches or pull requests

9 participants