Base websocket URL that is advertised to external clients.

    Useful when the websocket URL advertised to the clients needs to be
    customized (typically when running behind NAT, firewall, etc.)

def base_ws_uri():
    """Base websocket URL that is advertised to external clients.

    Useful when the websocket URL advertised to the clients needs to be
    customized (typically when running behind NAT, firewall, etc.)
    """

    scheme = config['wsserver']['advertised_scheme']
    host = config['wsserver']['advertised_host']
    port = config['wsserver']['advertised_port']
    return '{}://{}:{}'.format(scheme, host, port)