hewei.it před 4 roky
rodič
revize
93b0fa16f9
2 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 1 1
      examples/httpd/router.h
  2. 3 2
      http/server/HttpServer.h

+ 1 - 1
examples/httpd/router.h

@@ -24,7 +24,7 @@ public:
         });
 
         // curl -v http://ip:port/html/index.html
-        router.GET("/html/index.html", [&router](HttpRequest* req, HttpResponse* resp) {
+        router.GET("/html/index.html", [](HttpRequest* req, HttpResponse* resp) {
             return resp->File("html/index.html");
         });
 

+ 3 - 2
http/server/HttpServer.h

@@ -24,8 +24,9 @@ typedef struct http_server_s {
         strcpy(host, "0.0.0.0");
         // port = DEFAULT_HTTP_PORT;
         // https_port = DEFAULT_HTTPS_PORT;
-        port = 8080;
-        https_port = 8443;
+        // port = 8080;
+        // https_port = 8443;
+        port = https_port = 0;
         http_version = 1;
         worker_processes = 0;
         worker_threads = 0;