From b323368ffc3da51a5405f0e5080e76a82ebb703b Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sat, 21 Jul 2018 17:19:57 -0300 Subject: [PATCH] config: s/WEBSERVER_URL/WEBSOCKET_URL Also add explanation on how to use WEBSOCKET_URL --- config.example.py | 17 ++++++++++++++++- litecord/blueprints/gateway.py | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/config.example.py b/config.example.py index de6c35b..a17be93 100644 --- a/config.example.py +++ b/config.example.py @@ -3,11 +3,26 @@ MODE = 'Development' class Config: """Default configuration values for litecord.""" + # Enable debug logging? DEBUG = False + + # Enable ssl? (gives wss:// instead of ws:// on gateway route) IS_SSL = False - WEBSERVER_URL = 'localhost:5000' + + # what to give on gateway route? + # this must point to the websocket. + + # Set this url to somewhere *your users* + # will hit the websocket. + # e.g 'gateway.example.com' for reverse proxies. + WEBSOCKET_URL = 'localhost:5001' + + # Where to host the websocket? + # (a local address the server will bind to) WS_HOST = 'localhost' WS_PORT = 5001 + + # Postgres credentials POSTGRES = {} diff --git a/litecord/blueprints/gateway.py b/litecord/blueprints/gateway.py index 05b9cd0..9f1c4df 100644 --- a/litecord/blueprints/gateway.py +++ b/litecord/blueprints/gateway.py @@ -7,7 +7,7 @@ bp = Blueprint('gateway', __name__) def get_gw(): proto = 'wss://' if app.config['IS_SSL'] else 'ws://' - return f'{proto}{app.config["WEBSERVER_URL"]}/ws' + return f'{proto}{app.config["WEBSOCKET_URL"]}/ws' @bp.route('/gateway')