Added support for custom headers.

In some scenes, we need a Cookie header to do the authentication, which is common for sharing the same WebSocket server between Web browsers and iOS clients.