Closed prenone closed 3 years ago
I just noticed issue #27 which is the exact issue I had. This fixes it.
Hi @prenone
On Page 20 (...) all header field names in both HTTP requests and HTTP responses are case-insensitive.
Somehow i missed this statement in documentation.
Thank you for fixing it.
Per RFC 2616 HTTP headers (both keys and values) are case-insensitive. Changing
strcmp_P
tostrcasecmp_P
inWebSocketClient::_readResponse()
makes it compliant.I personally had an issue when placing NGINX proxy between a WebSocket client (mWebSockets) and a WebSocket server (ws) because NGINX normalizes every header (key and value) to be lower case. I suspect that there are many more incompatible WebSocket servers
Note:
strcasecmp_P
was already in use for the Upgrade header value.The library was tested and the connection was successfully established with the aforementioned NGINX proxy in place. The WebSocket connection should also be working fine as I didn't touch any of it, but I didn't actually test it thoroughly.
I also made analogous changes in WebSocketServer. I did not test it, but personally I think it is not necessary and should work fine.