What's wrong with this websocket response? (Error read response for Upgrade header)
Posted: Fri Mar 04, 2022 7:10 am
I'm using the example provided in examples/protocols/websocket to connect to my node.js/socket.io webserver. The websocket module and its associated transport_ws.c however is complaining that it can't read the following http header:
The header looks valid to me and it also works perfectly with my test javascript socket.io client. Digging down in the code, it seems that the transport_ws.c module issues this error when a deeper call to transport.c's esp_transport_read fails:
Do I maybe have to adapt my read function?
Code: Select all
E (531690) TRANSPORT_WS: Error read response for Upgrade header GET / HTTP/1.1
Connection: Upgrade
Host: <host_censored>:<port_censored>
User-Agent: ESP32 Websocket Client
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: fgofZlF6LAlrSHN8N17X+A==
Code: Select all
int esp_transport_read(esp_transport_handle_t t, char *buffer, int len, int timeout_ms)
{
if (t && t->_read) {
return t->_read(t, buffer, len, timeout_ms);
}
return -1;
}