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

added proxy support #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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