Clarification on python websockets example
<p>From the example found here: <a href="http://websockets.readthedocs.io/en/stable/intro.html" rel="nofollow">http://websockets.readthedocs.io/en/stable/intro.html</a></p>

<p>Can someone explain what the parameter 'path' does here? Is it a tuple for the host and port needed by websocket.serve()?</p>

<pre><code>import asyncio
import websockets

async def hello(websocket, path):
    name = await websocket.recv()
    print("&lt; {}".format(name))

    greeting = "Hello {}!".format(name)
    await websocket.send(greeting)
    print("&gt; {}".format(greeting))

start_server = websockets.serve(hello, 'localhost', 8765)

asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
</code></pre>

<p>The <a href="http://websockets.readthedocs.io/en/stable/api.html#websockets.server.serve" rel="nofollow">documentation for <code>websockets.serve</code></a> says that its first argument is <code>ws_handler</code>:</p>

<blockquote>
  <p>ws_handler is the WebSocket handler. It must be a coroutine accepting two arguments: a WebSocketServerProtocol and the request URI.</p>
</blockquote>

<p>In function <code>hello</code>, the second argument is not used, but it must accept the argument, because the argument is going to be sent to it by <code>websockets.serve</code>.</p>

python function websocket