Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

PY | websocket - client

#!/usr/bin/env python

import asyncio
import websockets

async def hello(uri):
    async with websockets.connect(uri) as websocket:
        await websocket.send("Hello world!")
        await websocket.recv()

asyncio.get_event_loop().run_until_complete(
    hello('ws://localhost:8765'))
Source by pythonrepo.com #
 
PREVIOUS NEXT
Tagged: #PY #websocket #client
ADD COMMENT
Topic
Name
9+4 =