CTBot icon indicating copy to clipboard operation
CTBot copied to clipboard

added proxy support

Open ivan140 opened this issue 6 years ago • 1 comments

This commit adds proxy support to the CTBot. For now only HTTP proxies are supported, so set CTBOT_USE_FINGERPRINT=0 . The requests fail, if the response time of the proxy takes to long. Test the proxy beforehand with python i.e. :

import http     
from http import client

h1 = http.client.HTTPConnection('34.244.2.233:8123')
# h1 = http.client.HTTPSConnection('api.telegram.org')
h1.request('GET','https://api.telegram.org/bot%ID:token%/getMe')
r1 = h1.getresponse()
print(r1.status, r1.reason)
print(r1.read())

The response should be:

200 OK
b'{"ok":true,"result":{"id":123456789,"is_bot":true,"first_name":"some_name","username":"some_nameBot"}}'

ivan140 avatar Feb 23 '19 13:02 ivan140

Hello Ivan, I'm a bit busy these weeks, sorry. I'll check your pull request as I have some spare time (soon I hope!!). Thanks so much for your work!

Stefano

shurillu avatar Mar 04 '19 10:03 shurillu