hewei.it 4 년 전
부모
커밋
93b0fa16f9
2개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  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;