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

Need proxy support for providers #236

Open
fakegit opened this issue Apr 14, 2019 · 5 comments
Open

Need proxy support for providers #236

fakegit opened this issue Apr 14, 2019 · 5 comments
Assignees
Milestone

Comments

@fakegit
Copy link

fakegit commented Apr 14, 2019

For me, I need proxy to use telegram and discord, hope this project has proxy support

@welcome
Copy link

welcome bot commented Apr 14, 2019

Thanks for opening your first issue here! Be sure to follow the issue template! 👋🐞👋

@liiight
Copy link
Owner

liiight commented Apr 14, 2019

Could you please elaborate on your use case?

@fakegit
Copy link
Author

fakegit commented Apr 14, 2019

telegram is blocked at where i lived, i must send notification to telegram through proxy, i'd like function like the code bellow:

from notifiers import get_notifier  
proxies = {'http': 'http://127.0.0.1:1080', 'https': 'socks5://127.0.0.1:1080'}
telegram = get_notifier('telegram')  
telegram.notify(message='Hi!', token='TOKEN', chat_id=1234, proxies=proxies)  ```

@liiight
Copy link
Owner

liiight commented Apr 14, 2019

Yeah, this is very doable. Currently the base URL is a class attribute, but making it passable should be fairly straightforward

@liiight liiight self-assigned this Apr 16, 2019
@liiight
Copy link
Owner

liiight commented Jun 23, 2019

Since notifiers uses requests, seems like there's a workaround for this:

$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

$ python
>>> import requests
>>> requests.get('http://example.org')

@liiight liiight modified the milestones: 1.2.0, 2.0.0 Jun 23, 2019
@liiight liiight added this to To do in Switch to pydantic via automation Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants