title: Is Socket IO connection still sending headers even after initial handshake?
body: <p>New to WebSockets and Socket.io, but read that one reason websockets are so much faster than HTTP requests is because <code>Once established, a websocket connection does not have to send headers with its messages</code>, and thus have less overhead with each data transfer. So in socket.io on a Node.js server, I tried:</p>
  
  <pre><code>...
  
  io.on('connection', (socket) =&gt; {
      console.log('initial', socket.id, socket.handshake.headers.cookie);
  
      socket.on('test', async (resHandler) =&gt; {
          console.log("socket test", socket.handshake.headers.cookie);
  
          let result = await dbFun.test(pool);
          console.log(result);
          resHandler(result);
      });
  })
  
  ...
  </code></pre>
  
  <p>On a client, I established a connection with this socket/server, and emmitted a 'test' event. I expected to see the socket cookie headers in the 'initial' log, but was surprised to see it appear in the 'socket test' log as well, when the 'test' event was emitted. Does this mean that, when the client socket emits an 'test' event, the socket still includes header data with each subsequent event, even after the initial handshake and the socket connection has been established? If so, how is this any different/faster than an HTTP request, which includes headers in every request?</p>