Beispiel #1
0
def viewIndex():
    player_name = settings['player_name']
    my_ip = get_node_ip()
    is_demo = is_demo_node()
    resin_uuid = getenv("RESIN_UUID", None)

    ws_addresses = []

    if settings['use_ssl']:
        ws_addresses.append('wss://' + my_ip + '/ws/')
    else:
        ws_addresses.append('ws://' + my_ip + ':' + settings['websocket_port'])

    if resin_uuid:
        ws_addresses.append('wss://{}.resindevice.io/ws/'.format(resin_uuid))

    return template('index.html', ws_addresses=ws_addresses, player_name=player_name, is_demo=is_demo)
Beispiel #2
0
def viewIndex():
    player_name = settings['player_name']
    my_ip = urlparse(request.host_url).hostname
    is_demo = is_demo_node()
    resin_uuid = getenv("RESIN_UUID", None)

    ws_addresses = []

    if settings['use_ssl']:
        ws_addresses.append('wss://' + my_ip + '/ws/')
    else:
        ws_addresses.append('ws://' + my_ip + ':' + settings['websocket_port'])

    if resin_uuid:
        ws_addresses.append('wss://{}.resindevice.io/ws/'.format(resin_uuid))

    return template('index.html', ws_addresses=ws_addresses, player_name=player_name, is_demo=is_demo)