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

Enable the use of system-wide proxys #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

niclasm17
Copy link

Allow homematic_exporter to use the system-wide configured http(s) proxy

Allow the use of system-wide proxy
def __init__(self):
proxy_http = os.environ.get('http_proxy')
proxy_https = os.environ.get('https_proxy')
proxy = proxy_https if proxy_https else proxy_http
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback is mostly intended, but not helpful when only one scheme needs a proxy and the other doesn't. And the main decision should be taken on the originally requested scheme.

super().__init__(self)

def make_connection(self, host):
if not self.proxy or host.startswith('https'):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even https could be proxied (through the https_proxy)

@sfudeus
Copy link
Owner

sfudeus commented Mar 24, 2024

Good suggestion, though it is a pity that the xmlrpc lient and transport don't support this out of the box.

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