Added support for custom HTTP headers during handshake.

This allows clients to specify custom HTTP headers when connecting.

Examples include cookies and HTTP basic authentication.