Skip to content

Commit 7ffc2e0

Browse files
committed
Moved refresh client from html meta tag to http header
Fixes #953
1 parent c018a2b commit 7ffc2e0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/WebServer/WebServer.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// The IP address will be dependent on your local network:
2323
byte mac[] = {
2424
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
25-
IPAddress ip(192,168,1, 177);
25+
IPAddress ip(192,168,1,177);
2626

2727
// Initialize the Ethernet server library
2828
// with the IP address and port you want to use
@@ -64,11 +64,10 @@ void loop() {
6464
client.println("HTTP/1.1 200 OK");
6565
client.println("Content-Type: text/html");
6666
client.println("Connection: close");
67+
client.println("Refresh: 5");
6768
client.println();
6869
client.println("<!DOCTYPE HTML>");
6970
client.println("<html>");
70-
// add a meta refresh tag, so the browser pulls again every 5 seconds:
71-
client.println("<meta http-equiv=\"refresh\" content=\"5\">");
7271
// output the value of each analog input pin
7372
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
7473
int sensorReading = analogRead(analogChannel);

0 commit comments

Comments
 (0)