# proxy between arduino switch and websockets
-# it listens on 0.0.0.0, UDP port 1312, and localhost, websocket port 8765
+# it listens on 0.0.0.0, UDP port 1312, "websocket" port 8765
import asyncio
import json
async def main():
loop = asyncio.get_running_loop()
proto = PanikSwitchProtocol()
- await websockets.serve(proto.websocket_handler, 'localhost', 8765)
+ await websockets.serve(proto.websocket_handler, '0.0.0.0', 8765)
transport, protocol = await loop.create_datagram_endpoint(lambda: proto, local_addr=('0.0.0.0', 1312))
while True:
try: