Exemple #1
0
        control_1(value)
    elif (control == '2'):
        control_2(value)
    elif (control == '3'):
        control_3(value)
    elif (control == '4'):
        control_4(value)
    elif (control == '5'):
        control_5(value)
    elif (control == '6'):
        control_6(value)
    else:
        print("Error")


#### Server setup
def message_received(client, server, message):
    control_dispatch(message)


def new_client(client, server):
    print("Client joined")


server = WebsocketServer(8000, host='0.0.0.0')
server.set_fn_new_client(new_client)

server.message_received = message_received

server.run_forever()