title: What's the URI path component in websocket used for?
body: <p>The client initiates a websocket handshake and can specify a custom URI path to use.</p>
  <pre><code>    GET **/chat** HTTP/1.1
      Host: server.example.com
      Upgrade: websocket
      Connection: Upgrade
      Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
      Origin: http://example.com
      Sec-WebSocket-Protocol: chat, superchat
      Sec-WebSocket-Version: 13
  </code></pre>
  <p>The websocket uri takes this form:
  <a href="https://www.rfc-editor.org/rfc/rfc6455#section-3" rel="nofollow noreferrer">ws-URI = &quot;ws:&quot; &quot;//&quot; host [ &quot;:&quot; port ] path [ &quot;?&quot; query ]</a></p>
  <p>If I deploy a websocket server listening on <code>ws://localhost:8080/</code> and a client connects there with the following uri <code>ws://localhost:8080/chat</code>, what's the difference? Why is a path component even necessary? It's there just for load balancing? Or are these &quot;endpoints&quot; isolated?</p>
  <p>The following statement in the RFC is quite confusing to me:</p>
  <p>The &quot;Request-URI&quot; of the GET method [RFC2616] is used to identify the
  endpoint of the WebSocket connection, both to allow multiple domains
  to be served from one IP address and to allow multiple WebSocket
  endpoints to be served by a single server. (<a href="https://www.rfc-editor.org/rfc/rfc6455#section-1.3" rel="nofollow noreferrer">HERE</a>)</p>