Skip to content

Commit 9157bb8

Browse files
authored
Configurable scheme to support https
1 parent 790e139 commit 9157bb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

netdata/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
class Netdata(object):
2323
"""A class for handling connections with a Netdata instance."""
2424

25-
def __init__(self, host, loop, session, port=19999, path=None):
25+
def __init__(self, host, loop, session, scheme='http', port=19999, path=None):
2626
"""Initialize the connection to the Netdata instance."""
2727
self._loop = loop
2828
self._session = session
2929
self.host = host
3030
self.port = port
3131
self.values = self.alarms = self.metrics = None
3232
if path is None:
33-
self.base_url = URL.build(scheme="http", host=host, port=port, path=f"/api/v{API_VERSION}/")
33+
self.base_url = URL.build(scheme, host=host, port=port, path=f"/api/v{API_VERSION}/")
3434
else:
35-
self.base_url = URL.build(scheme="http", host=host, port=port, path=path)
35+
self.base_url = URL.build(scheme, host=host, port=port, path=path)
3636

3737

3838
async def get_data(self, resource):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy