Fix two issues: missing query parameter, and incorrect line breaker handling

1. raw query is missing when handshake, it's common add some query parameters in the web socket url.
2. if the message contains line breakers, they are escaped which causes runtime exception.