async def eventlog():
    try:
        async with websockets.connect(((('ws://' + remoteServerIP) + ':') + remoteServerWSPort)) as websocket:
            (await websocket.send(json.dumps(hello)))
            while True:
                event = (await websocket.recv())
                eventObj = json.loads(event)
                print('eventObj:', eventObj)
                if (eventObj['type'] and (eventObj['type'] == 'ping')):
                    (await websocket.send(json.dumps(ping)))
                elif (eventObj['type'] and (eventObj['type'] == 'pub')):
                    r = requests.post(((((('http://' + localServerIP) + ':') + localServerAPIPort) + localServerPath) + eventsAPIPath), headers=localHeaders, data=json.dumps(eventObj['message']))
                    print(r.text)
    except Exception as error:
        print(error)
async def eventlog():
    try:
        async with websockets.connect(((('ws://' + remoteServerIP) + ':') + remoteServerWSPort)) as websocket:
            (await websocket.send(json.dumps(hello)))
            while True:
                event = (await websocket.recv())
                eventObj = json.loads(event)
                print('eventObj:', eventObj)
                if (eventObj['type'] and (eventObj['type'] == 'ping')):
                    (await websocket.send(json.dumps(ping)))
                elif (eventObj['type'] and (eventObj['type'] == 'pub')):
                    r = requests.post(((((('http://' + localServerIP) + ':') + localServerAPIPort) + localServerPath) + eventsAPIPath), headers=localHeaders, data=json.dumps(eventObj['message']))
                    print(r.text)
    except Exception as error:
        print(error)