if (httpCode == HTTP_CODE_TEMPORARY_REDIRECT ) { //HTTP_CODE_TEMPORARY_REDIRECT 307
const char* headerNames[] = { "Location", "Last-Modified" };
http.collectHeaders(headerNames, sizeof(headerNames) / sizeof(headerNames[0]));
int rc = http.GET();
Serial.println(rc);
String location = http.header("Location");
Serial.println("location ");
Serial.println(http.header("Location"));
http.setReuse(false);
http.end();
http.begin(location);
// http.addHeader("Accept", "text/event-stream");
// http.addHeader("Cache-Control", "no-cache");
http.setReuse(true);
Serial.println("CAME FROM 307! ");
httpCode = http.GET();
if (httpCode == HTTP_CODE_OK) {
Serial.println("CANT ENTER HRE ");
// get lenght of document (is -1 when Server sends no Content-Length header)
int len = http.getSize();
...
When i go to new location (with a browser page it i see my data) but i cant go on with esp side : Serial.println("CANT ENTER HRE ");
@Links2004 I cant reach loop when its streaming. Is there a trick?
// read all data from server
while (http.connected() && (len > 0 || len == -1)) {
// get available data size
size_t size = stream->available();
if (size) {
// read up to 128 byte
int c = stream->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));
// write it to Serial
USE_SERIAL.write(buff, c);
if (len > 0) {
len -= c;
}
}
delay(1);
}
Do i have to put all loop functions inside while(... function?
C:\Users\klemen\Documents\Arduino\libraries\arduinoWebSockets\src\WebSockets.cpp:42:18: fatal error: Hash.h: No such file or directory
In file included from C:\Users\leder\Documents\Arduino\libraries\WebSockets\src/WebSocketsClient.h:28:0,
from C:\Users\leder\Documents\Arduino\libraries\WebSockets\examples\avr\WebSocketClientAVR\WebSocketClientAVR.ino:13:
C:\Users\leder\Documents\Arduino\libraries\WebSockets\src/WebSockets.h:35:22: fatal error: functional: No such file or directory
Hi there! Thank you for time and your effort.
I have a general question (newbie) about arduinoWebSockets and ESPAsyncWebServer. I'm using ESP 8266 or ESP 32 modules, and as far as I understand both of them are supported in both libraries.
So my aim is to have a website for controlling the ESP and showing the status and some information on a website. Which is stored as .html or .css in Flash with SPIFFS (which can be done with the SPIFFSEditor.h library , am I wrong?
The provided examples of both library work (one already uses SPIFFS).
I would appreciate if someone could perhaps outline the differences / pro /contra or your opinion about the two libraries, please?
Hi, I'm trying to establish a websocket connection to a server which supports the following ciphers
Testing ECDHE-RSA-AES256-GCM-SHA384...YES
Testing ECDHE-RSA-AES256-SHA...YES
Testing ECDHE-RSA-AES128-GCM-SHA256...YES
Testing ECDHE-RSA-AES128-SHA...YES
Is it possible to do this using the ESP8266? An help would be much appreciated, so far I always get a Error: SSL error 40.
hello everyone I have a question regarding https://github.com/Links2004/arduinoWebSockets/blob/master/examples/esp8266/WebSocketClientStomp/WebSocketClientStomp.ino
I managed to establish connection to my spring /ws and it says
[WSc] Connected to url: /ws
but whenever I publish json to /topic or /queue on that websocket there is no response in WebSocketClientStomp.ino
I suppose it should be handled by this case branch?
case WStype_TEXT: ...
Did anyone had similar usecase?
Thanks
Jan