File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,16 @@ void testCallback(HTTPRequest * req, HTTPResponse * res) {
22
22
res->println (" <!DOCTYPE html>" );
23
23
res->println (" <html>" );
24
24
res->println (" <head>" );
25
- res->println (" <title>HTTPS Server on ESP32</title>" );
25
+ if (res->_con ->ssl ()) // test if connection is encrypted
26
+ res->println (" <title>HTTPS Server on ESP32</title>" );
27
+ else
28
+ res->println (" <title>HTTP Server on ESP32</title>" );
26
29
res->println (" </head>" );
27
30
res->println (" <body>" );
28
- res->println (" <h1>Hello world!</h1>" );
31
+ if (res->_con ->ssl ()) // test if connection is encrypted
32
+ res->println (" <h1>Hello HTTPS world!</h1>" );
33
+ else
34
+ res->println (" <h1>Hello HTTP world!</h1>" );
29
35
res->println (" <p>... from your ESP32</p>" );
30
36
// The image resource is created in the awesomeCallback some lines below
31
37
res->println (" <img src=\" images/awesome.svg\" alt=\" Awesome face\" style=\" width:250px;\" />" );
@@ -333,4 +339,4 @@ void serverTask(void *params) {
333
339
ESP.restart ();
334
340
}
335
341
336
- }
342
+ }
You can’t perform that action at this time.
0 commit comments