webSocketHandshakeResponse function

Uint8List webSocketHandshakeResponse(
  1. String acceptKey
)

The 101 response that completes the handshake, as bytes for the wire.

Implementation

Uint8List webSocketHandshakeResponse(String acceptKey) => utf8.encode(
  'HTTP/1.1 101 Switching Protocols\r\n'
  'Upgrade: websocket\r\n'
  'Connection: Upgrade\r\n'
  'Sec-WebSocket-Accept: $acceptKey\r\n'
  'Date: ${httpDate()}\r\n'
  '\r\n',
);