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

Use Mopidy's proxy settings #18

Closed
kingosticks opened this issue May 14, 2015 · 2 comments
Closed

Use Mopidy's proxy settings #18

kingosticks opened this issue May 14, 2015 · 2 comments

Comments

@kingosticks
Copy link
Owner

Mopidy defines a proxy configuration which we should use for all our requests.

@kingosticks
Copy link
Owner Author

Something like:

from mopidy import httpclient

def TuneInBackend.__init__(...)
    proxy_string = httpclient.format_proxy(config)
    proxy_scheme = proxy_string.split('://', 1)
    if proxy_string and proxy_scheme:
        proxy = {proxy_scheme : proxy_string}
    else:
        proxy = None
    tunein.TuneIn(config['tunein']['timeout'], proxy)

def TuneIn.__init__(..., proxies=None):
    if proxies:
        self._session.proxies = proxies

@jodal
Copy link

jodal commented Jul 28, 2015

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

No branches or pull requests

2 participants