aboutsummaryrefslogtreecommitdiffstats
path: root/clients
diff options
context:
space:
mode:
authorBlake DeMarcy <desvox@tilde.town>2018-02-13 22:12:56 -0600
committerBlake DeMarcy <desvox@tilde.town>2018-02-13 22:12:56 -0600
commit33dd0a361d703ad4518886ca4b94fec6045c9b0e (patch)
tree66a66fd001127b3b1c82c896b66585ebb15cdb3c /clients
parente0f83592dc5f22a07f79f97ccc63ac66e917e2c7 (diff)
downloadbbj-33dd0a361d703ad4518886ca4b94fec6045c9b0e.tar.gz
basic ass https support
Diffstat (limited to 'clients')
-rw-r--r--clients/network_client.py4
-rw-r--r--clients/urwid/main.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/clients/network_client.py b/clients/network_client.py
index 8278ae4..87f870e 100644
--- a/clients/network_client.py
+++ b/clients/network_client.py
@@ -49,7 +49,7 @@ class BBJ(object):
See the offical API error documentation for more details.
"""
- def __init__(self, host="127.0.0.1", port=7099):
+ def __init__(self, host="127.0.0.1", port=7099, https=False):
"""
Optionally takes port and host as kwargs. It will immediately
try to resolve a connection to the server, if its down, it
@@ -71,7 +71,7 @@ class BBJ(object):
If you set this to False, anonymous network usage is
guaranteed.
"""
- self.base = "http://{}:{}/api/%s".format(host, port)
+ self.base = "http{}://{}:{}/api/%s".format("s" if https else "", host, port)
self.user_name = self.user_auth = None
self.send_auth = True
try:
diff --git a/clients/urwid/main.py b/clients/urwid/main.py
index ab5050a..229d03d 100644
--- a/clients/urwid/main.py
+++ b/clients/urwid/main.py
@@ -46,7 +46,7 @@ def get_arg(key, default=None, get_value=True):
return value
try:
- network = BBJ(get_arg("host", "127.0.0.1"), get_arg("port", 7099))
+ network = BBJ(get_arg("host", "127.0.0.1"), get_arg("port", 7099), get_arg("https", False, False))
except URLError as e:
# print the connection error in red
exit("\033[0;31m%s\033[0m" % repr(e))
Un proyecto texto-plano.xyz