Skip to content

added proxy support#19

Open
ivan140 wants to merge 2 commits intoshurillu:masterfrom
ivan140:proxy_support
Open

added proxy support#19
ivan140 wants to merge 2 commits intoshurillu:masterfrom
ivan140:proxy_support

Conversation

@ivan140
Copy link

@ivan140 ivan140 commented Feb 23, 2019

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"}}'

@shurillu
Copy link
Owner

shurillu commented Mar 4, 2019

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants