OctoPrint-Telegram
OctoPrint-Telegram copied to clipboard
Implements a Proxy Integration
Now, you can use HTTP or SOCKS5 proxies with this bot. In config.yaml under telegram add the two following lines: http_proxy: http://user:[email protected]:3128 https_proxy: http://user:[email protected]:3128
If you are using SOCKS5 proxy, the lines looks like this: http_proxy: socks5://user:[email protected]:3128 https_proxy: socks5://user:[email protected]:3128
Maybe you have to run the following line to install socks-compability: pip install requests[socks]
The provider blocks DNS requests or substitutes. Wrap the DNS in a proxy or Tor.
![2018-05-17_17-01-28] The provider blocks DNS requests or substitutes. Wrap the DNS in a proxy or Tor.
Official docs for python requests
@StrannikZet
Use socks5h
scheme instead of socks5
.
Ensure your proxy allows dns resolving:
Simulation of local resolver
curl --socks5 your-proxy-host:port https://api.telegram.org -v -v
Simulation of remote resolver (through your socks5)
curl --socks5-hostname your-proxy-host:port https://api.telegram.org -v -v
@fabianonline Please take a note on this. Very popular feature in Russia
![2018-05-17_17-01-28] The provider blocks DNS requests or substitutes. Wrap the DNS in a proxy or Tor.
Official docs for python
requests
@StrannikZet Usesocks5h
scheme instead ofsocks5
.Ensure your proxy allows dns resolving:
Simulation of local resolver
curl --socks5 your-proxy-host:port https://api.telegram.org -v -v
Simulation of remote resolver (through your socks5)
curl --socks5-hostname your-proxy-host:port https://api.telegram.org -v -v
I have corrected. Thank you, it works!
It is very useful! Can't wait for merge.
It doesn't work any more. Neither socks5 nor socks5h make possible to connect to the server. I receive "Got an exception while initially trying to connect to telegram (Listener not running: HTTPSConnectionPool(host='api.telegram.org', port=443)". Is any idea?
@Spirituss it works for me.
You can try to ping host api.telegram.org
from terminal of your octoprint server.
If it doesn't work, change primary dns server i.e. to Google dns 8.8.8.8
or 8.8.4.4
.
It doesn't work any more. Neither socks5 nor socks5h make possible to connect to the server. I receive "Got an exception while initially trying to connect to telegram (Listener not running: HTTPSConnectionPool(host='api.telegram.org', port=443)". Is any idea?
Works good for me. Probably your socks provider is dead ?
@Spirituss it works for me. You can try to ping host
api.telegram.org
from terminal of your octoprint server. If it doesn't work, change primary dns server i.e. to Google dns8.8.8.8
or8.8.4.4
.
You should not change DNS servers. Use "socks5h" instead of "socks5" - this makes DNS resolutions made by socks server, not by client ( "socks5" resolves names NOT through proxy )
@Spirituss it works for me. You can try to ping host
api.telegram.org
from terminal of your octoprint server. If it doesn't work, change primary dns server i.e. to Google dns8.8.8.8
or8.8.4.4
.
This does not work! Providers intercept requests for addresses 8.8.8.8 and 8.8.4.4 for the operation of blocking services.
@Spirituss it works for me. You can try to ping host
api.telegram.org
from terminal of your octoprint server. If it doesn't work, change primary dns server i.e. to Google dns8.8.8.8
or8.8.4.4
.This does not work! Providers intercept requests for addresses 8.8.8.8 and 8.8.4.4 for the operation of blocking services.
You can take 1.1.1.1 or 1.0.0.1 DNS
please, see this way (nging proxy) Add custom server, not api.telegram.org
https://habr.com/ru/post/424427/
Hi,
I will finally try to implement that in the master. as there was a lot of conflict I'll implement it on my fork and ask for someone to test because I don't work with proxies.