WebSocket component: to make it more complient with rfc6455

Igor Khomenko
Added about 1 year ago

Hi guys,

Recently I played with development.

I used lib to connect to Tigase but unfortunately spent almost one day to figure out why it was not working (was not able to even open WS connection)

Then after some deep debugging I realized that this lib sends the Connection: upgrade header when handshake. But Tigase expects it as Connection: Upgrade here

I tried to modify the nativescript-websockets lib but then realized it uses another lib inside to cope with WS - PocketSocket and it's actually it sets this header in lower case format:

My first thought was that it's a bug with the PocketSocket lib.

But then I investigated the rfc6455 and found the following rule in 4.2.1 section:

  1. A |Connection| header field that includes the token "Upgrade",

treated as an ASCII case-insensitive value.

So it seems that clients can send this header in any format: Upgrade or upgrade.

Are you able to modify Tigase code a little bit and make it more complient with the spec?

Thank you

Replies (1)


Added by Artur Hefczyc TigaseTeam about 1 year ago

Thank you very much for detailed information and the in-depth research on the problem. I have opened a bug report for this: #6481. Please "watch" the bug report to get automated updated on the resolution progress.