{"id":116132,"date":"2026-10-20T19:40:39","date_gmt":"2026-10-20T11:40:39","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/116132.html"},"modified":"2026-10-20T19:40:39","modified_gmt":"2026-10-20T11:40:39","slug":"includeos-http-%e9%9b%86%e6%88%90%e6%b5%8b%e8%af%95%e5%ae%9e%e6%88%98%ef%bc%9a%e5%9c%a8%e6%9c%ac%e5%9c%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e9%aa%8c%e8%af%81-http-%e5%ae%a2%e6%88%b7%e7%ab%af","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/116132.html","title":{"rendered":"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u64cd\u4f5c\u7cfb\u7edf<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><\/li>\n<li><span class=\"gcb-tag\">\u865a\u62df\u5316<\/span><\/li>\n<li><span class=\"gcb-tag\">\u7f51\u7edc<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011IncludeOS<\/h3>\n<p class=\"gcb-project-desc\">A minimal, resource efficient unikernel for cloud services<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/in\/IncludeOS<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h3>\u5bfc\u8bfb<\/h3>\n<p>\u672c\u6587\u56f4\u7ed5 test\/integration\/net\/http\/README.md \u6240\u63cf\u8ff0\u7684 HTTP \u96c6\u6210\u6d4b\u8bd5\u5c55\u5f00&#xff0c;\u6df1\u5165\u8bb2\u89e3 IncludeOS \u5982\u4f55\u5728 unikernel \u5185\u90e8\u540c\u65f6\u542f\u52a8 http::Server \u4e0e http::Basic_client&#xff0c;\u5e76\u501f\u52a9\u5bbf\u4e3b\u673a\u4e0a\u7684 Python HTTP \u670d\u52a1\u5668\u4e0e vmrunner \u5b8c\u6210\u53cc\u5411\u9a8c\u8bc1\u3002\u8bfb\u5b8c\u672c\u6587&#xff0c;\u4f60\u5c06\u638c\u63e1&#xff1a;IncludeOS HTTP \u670d\u52a1\u7684\u6784\u5efa\u4e0e\u7f51\u7edc\u914d\u7f6e\u65b9\u5f0f\u3001\u670d\u52a1\u7aef\u8bf7\u6c42\u56de\u8c03\u4e0e\u54cd\u5e94\u5199\u5165\u7684 API \u7528\u6cd5\u3001\u5ba2\u6237\u7aef\u8bf7\u6c42\u6784\u9020\u4e0e\u9519\u8bef\u5904\u7406\u673a\u5236&#xff0c;\u4ee5\u53ca\u6574\u4e2a\u96c6\u6210\u6d4b\u8bd5\u4ece\u542f\u52a8 VM \u5230\u65ad\u8a00\u8f93\u51fa\u7684\u5b8c\u6574\u8fd0\u884c\u94fe\u8def\u3002<\/p>\n<p>\u539f\u6587\u6863\u6838\u5fc3\u4fe1\u606f\u4ec5\u6709\u4e24\u53e5\u8bdd&#xff1a;\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u6d4b\u8bd5 HTTP Client&#xff0c;\u4ee5\u53ca \u51fa\u7ad9&#xff08;outgoing&#xff09;\u6d4b\u8bd5\u9700\u8981\u6b63\u786e\u7684\u7f51\u7edc\u914d\u7f6e\u3002\u672c\u6587\u4ee5\u8fd9\u4e24\u70b9\u4e3a\u9aa8\u67b6&#xff0c;\u7ed3\u5408 test\/integration\/net\/http\/ \u76ee\u5f55\u4e0b\u7684\u5168\u90e8\u6d4b\u8bd5\u6587\u4ef6\u4e0e api\/net\/http\/\u3001src\/net\/http\/ \u7684\u6e90\u7801\u5b9e\u73b0&#xff0c;\u5c55\u5f00\u4e3a\u4e00\u4efd\u53ef\u8fd0\u884c\u7684\u5b9e\u6218\u6307\u5357\u3002<\/p>\n<h3>\u4e00\u3001\u6d4b\u8bd5\u5168\u666f&#xff1a;\u4e00\u4e2a VM \u5185\u540c\u65f6\u626e\u6f14\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668<\/h3>\n<p>test\/integration\/net\/http\/ \u76ee\u5f55\u4e0b\u5171\u6709 6 \u4e2a\u6587\u4ef6&#xff0c;\u6784\u6210\u4e86\u5b8c\u6574\u7684\u6d4b\u8bd5\u4f53\u7cfb&#xff1a;<\/p>\n<table>\n<tr>\u6587\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>service.cpp<\/td>\n<td>unikernel \u670d\u52a1\u4e3b\u4f53&#xff1a;\u914d\u7f6e\u7f51\u7edc\u3001\u542f\u52a8 HTTP \u670d\u52a1\u5668\u3001\u6784\u9020 HTTP \u5ba2\u6237\u7aef\u5e76\u53d1\u9001\u8bf7\u6c42<\/td>\n<\/tr>\n<tr>\n<td>test.py<\/td>\n<td>\u5bbf\u4e3b\u7aef Python \u9a71\u52a8&#xff1a;\u5728 9011 \u7aef\u53e3\u8d77\u4e00\u4e2a\u56de\u663e\u670d\u52a1\u5668&#xff0c;\u5e76\u7528 vmrunner \u542f\u52a8\/\u65ad\u8a00 VM<\/td>\n<\/tr>\n<tr>\n<td>run.sh<\/td>\n<td>\u542f\u52a8\u811a\u672c&#xff1a;\u521b\u5efa\u6865\u63a5\u7f51\u7edc\u540e\u8fd0\u884c VM \u955c\u50cf<\/td>\n<\/tr>\n<tr>\n<td>CMakeLists.txt<\/td>\n<td>\u6784\u5efa\u914d\u7f6e&#xff1a;\u751f\u6210\u540d\u4e3a net_http \u7684\u53ef\u6267\u884c\u955c\u50cf&#xff0c;\u5e76\u6302\u8f7d virtionet \u7f51\u5361\u9a71\u52a8<\/td>\n<\/tr>\n<tr>\n<td>vm.json<\/td>\n<td>VM \u914d\u7f6e&#xff1a;\u6307\u5b9a virtio \u7f51\u5361\u3001MAC \u5730\u5740\u4e0e\u5185\u5b58\u5927\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>README.md<\/td>\n<td>\u672c\u6587\u6240\u5bf9\u5e94\u7684\u539f\u59cb\u6d4b\u8bd5\u8bf4\u660e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6d4b\u8bd5\u7684\u6838\u5fc3\u601d\u8def\u662f&#xff1a;IncludeOS \u670d\u52a1\u5728 VM \u5185\u76d1\u542c 8080 \u7aef\u53e3\u626e\u6f14 HTTP \u670d\u52a1\u5668&#xff1b;\u5bbf\u4e3b\u673a\u901a\u8fc7 Python HTTP \u670d\u52a1\u5668\u5728 9011 \u7aef\u53e3\u626e\u6f14\u5916\u90e8\u670d\u52a1\u5668&#xff1b;VM \u5185\u7684 HTTP \u5ba2\u6237\u7aef\u5411\u5bbf\u4e3b\u673a\u53d1\u8d77\u51fa\u7ad9\u8bf7\u6c42\u3002\u8fd9\u6070\u597d\u8986\u76d6\u4e86\u670d\u52a1\u7aef\u4e0e\u5ba2\u6237\u7aef\u4e24\u4e2a\u65b9\u5411&#xff0c;\u4e5f\u662f\u539f\u6587\u6863\u5f3a\u8c03&#034;\u51fa\u7ad9\u6d4b\u8bd5\u9700\u8981\u6b63\u786e\u7f51\u7edc\u914d\u7f6e&#034;\u7684\u539f\u56e0\u2014\u2014VM \u5185\u7684\u5ba2\u6237\u7aef\u8981\u8bbf\u95ee\u5bbf\u4e3b\u673a\u7684 9011 \u7aef\u53e3&#xff0c;\u5fc5\u987b\u5148\u6253\u901a\u6865\u63a5\u7f51\u7edc\u3002<\/p>\n<p>\u4ece test\/README.md \u53ef\u4ee5\u770b\u5230&#xff0c;\u672c\u6d4b\u8bd5\u56fa\u5b9a\u5360\u7528 10.0.0.46 \u8fd9\u4e00 IP \u5730\u5740&#xff0c;\u4e0e\u5176\u4ed6\u7f51\u7edc\u6d4b\u8bd5&#xff08;\u5982 tcp \u7528 10.0.0.44\u3001dns \u7528 10.0.0.48&#xff09;\u9519\u5f00&#xff0c;\u907f\u514d\u5e76\u884c\u8fd0\u884c\u65f6\u53d1\u751f\u5730\u5740\u51b2\u7a81\u3002<\/p>\n<h3>\u4e8c\u3001\u6784\u5efa\u914d\u7f6e&#xff1a;\u5982\u4f55\u628a\u4e00\u4e2a HTTP \u670d\u52a1\u7f16\u8bd1\u6210\u955c\u50cf<\/h3>\n<p>CMakeLists.txt \u5c55\u793a\u4e86 IncludeOS \u670d\u52a1\u6807\u51c6\u7684\u4e09\u6bb5\u5f0f\u6784\u5efa\u5199\u6cd5&#xff1a;<\/p>\n<p>cmake_minimum_required(VERSION 3.31.6)<br \/>\nset(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)<\/p>\n<p>project (service)<br \/>\ninclude(os)<\/p>\n<p>set(SOURCES<br \/>\n  service.cpp<br \/>\n)<\/p>\n<p>os_add_executable(net_http &#034;HTTP test&#034; ${SOURCES})<br \/>\nos_add_drivers(net_http virtionet)<br \/>\nos_add_stdout(net_http default_stdout)<br \/>\nconfigure_file(test.py ${CMAKE_CURRENT_BINARY_DIR})<\/p>\n<p>\u8981\u70b9\u89e3\u8bfb&#xff1a;<\/p>\n<ul>\n<li>os_add_executable(net_http &#034;HTTP test&#034; ${SOURCES})&#xff1a;\u628a service.cpp \u7f16\u8bd1\u94fe\u63a5\u4e3a\u540d\u4e3a net_http \u7684 unikernel \u955c\u50cf&#xff0c;\u8f93\u51fa\u4e8c\u8fdb\u5236\u4e3a net_http.elf.bin&#xff08;\u8fd9\u6b63\u662f test.py \u672b\u5c3e vm.boot(20, image_name&#061;&#039;net_http.elf.bin&#039;) \u6240\u5f15\u7528\u7684\u955c\u50cf\u540d&#xff09;\u3002<\/li>\n<li>os_add_drivers(net_http virtionet)&#xff1a;\u6302\u8f7d virtio \u7f51\u7edc\u9a71\u52a8&#xff0c;\u4f7f VM \u80fd\u591f\u4f7f\u7528 vm.json \u4e2d\u58f0\u660e\u7684 virtio \u7f51\u5361\u3002<\/li>\n<li>os_add_stdout(net_http default_stdout)&#xff1a;\u5c06\u6807\u51c6\u8f93\u51fa\u7ed1\u5b9a\u5230\u9ed8\u8ba4 stdout \u9a71\u52a8&#xff0c;\u786e\u4fdd INFO\u3001printf \u6253\u5370\u7684\u5185\u5bb9\u80fd\u591f\u88ab vmrunner \u6355\u83b7&#xff0c;\u7528\u4e8e\u540e\u7eed\u7684\u8f93\u51fa\u5339\u914d\u89e6\u53d1\u3002<\/li>\n<li>configure_file(test.py &#8230;)&#xff1a;\u628a\u6d4b\u8bd5\u9a71\u52a8\u811a\u672c\u590d\u5236\u5230\u6784\u5efa\u76ee\u5f55&#xff0c;\u65b9\u4fbf\u4e0e\u955c\u50cf\u653e\u5728\u4e00\u8d77\u6267\u884c\u3002<\/li>\n<\/ul>\n<p>\u5bf9\u5e94\u7684 VM \u8d44\u6e90\u914d\u7f6e\u89c1 vm.json&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;net&#034; : [{&#034;device&#034; : &#034;virtio&#034;, &#034;mac&#034; : &#034;c0:01:0a:00:00:2a&#034;}],<br \/>\n  &#034;mem&#034;   : 256<br \/>\n}<\/p>\n<p>\u8fd9\u91cc\u58f0\u660e\u4e86\u4e00\u5757 virtio \u7f51\u5361&#xff08;MAC \u4e3a c0:01:0a:00:00:2a&#xff0c;\u5c5e\u4e8e\u6865\u63a5\u7f51\u6bb5 10.0.0.x \u5bf9\u5e94\u7684\u5730\u5740\u89c4\u5212&#xff09;\u4e0e 256 MB \u5185\u5b58&#xff0c;\u4e3a\u540e\u7eed\u7f51\u7edc\u4ea4\u4e92\u63d0\u4f9b\u786c\u4ef6\u57fa\u7840\u3002<\/p>\n<h3>\u4e09\u3001\u670d\u52a1\u7aef\u4ee3\u7801\u5256\u6790&#xff1a;10 \u884c\u56de\u8c03\u642d\u8d77\u4e00\u4e2a HTTP \u670d\u52a1\u5668<\/h3>\n<p>service.cpp \u5728 Service::ready() \u4e2d\u5b8c\u6210\u4e86\u5168\u90e8\u6d4b\u8bd5\u903b\u8f91\u3002\u9996\u5148\u4e3a\u63a5\u53e3 0 \u914d\u7f6e\u9759\u6001\u7f51\u7edc&#xff1a;<\/p>\n<p>auto&amp; inet &#061; net::Interfaces::get(0);<br \/>\ninet.network_config(<br \/>\n  {  10,  0,  0, 46 },  \/\/ IP<br \/>\n  {  255,255,255, 0 },  \/\/ Netmask<br \/>\n  {  10,  0,  0,  1 },  \/\/ Gateway<br \/>\n  {  8,  8,  8,  8 }   \/\/ DNS<br \/>\n);<\/p>\n<ul>\n<li>IP 10.0.0.46 \u4e0e test\/README.md \u4e2d\u7684\u5730\u5740\u5206\u914d\u8868\u4e00\u81f4&#xff1b;<\/li>\n<li>\u7f51\u5173 10.0.0.1 \u662f\u6865\u63a5\u7f51\u7edc\u4e2d\u5bbf\u4e3b\u673a\u7684\u5730\u5740\u2014\u2014\u5ba2\u6237\u7aef\u540e\u7eed\u5c31\u5411\u8fd9\u4e2a\u5730\u5740\u7684 9011 \u7aef\u53e3\u53d1\u8bf7\u6c42&#xff1b;<\/li>\n<li>DNS 8.8.8.8 \u7528\u4e8e\u57df\u540d\u89e3\u6790&#xff08;\u6d4b\u8bd5\u4e2d\u867d\u672a\u771f\u6b63\u51fa\u7ad9\u8bbf\u95ee\u5916\u7f51&#xff0c;\u4f46\u5730\u5740\u4ecd\u88ab\u914d\u7f6e&#xff09;\u3002<\/li>\n<\/ul>\n<h4>3.1 \u670d\u52a1\u5668&#xff1a;on_request \u56de\u8c03 &#043; Response_writer<\/h4>\n<p>\u968f\u540e\u521b\u5efa http::Server \u5e76\u6ce8\u518c\u8bf7\u6c42\u5904\u7406\u56de\u8c03&#xff1a;<\/p>\n<p>server_ &#061; std::make_unique&lt;Server&gt;(inet.tcp());<\/p>\n<p>server_-&gt;on_request([] (Request_ptr req, Response_writer_ptr writer)<br \/>\n{<br \/>\n  printf(&#034;Received request:\\\\n%s\\\\n&#034;, req-&gt;to_string().c_str());<br \/>\n  \/\/ set content type<br \/>\n  writer-&gt;header().set_field(header::Content_Type, &#034;text\/plain&#034;);<br \/>\n  \/\/ write body<br \/>\n  writer-&gt;write(&#034;Hello&#034;);<br \/>\n});<\/p>\n<p>server_-&gt;listen(8080);<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5bf9\u5e94 server.hpp \u4e2d\u5b9a\u4e49\u7684 API&#xff1a;<\/p>\n<ul>\n<li>on_request(Request_handler handler)&#xff1a;\u6ce8\u518c\u8bf7\u6c42\u56de\u8c03\u3002\u56de\u8c03\u7b7e\u540d\u662f delegate&lt;void(Request_ptr, Response_writer_ptr)&gt;&#xff0c;\u5f53\u89e3\u6790\u5230\u5b8c\u6574\u8bf7\u6c42\u65f6\u88ab\u89e6\u53d1&#xff08;\u89c1 server.cpp \u7684 Server::receive&#xff09;\u3002<\/li>\n<li>listen(const uint16_t port)&#xff1a;\u7ed1\u5b9a\u7aef\u53e3\u5f00\u59cb\u76d1\u542c\u3002\u4ece server.cpp \u7684\u5b9e\u73b0\u53ef\u89c1&#xff0c;listen \u4f1a\u5148\u65ad\u8a00 on_request_ \u5df2\u8bbe\u7f6e&#xff08;&#034;You must set &#039;on_request&#039; on the server to receive requests!&#034;&#xff09;&#xff0c;\u518d\u8c03\u7528 bind(port) \u901a\u8fc7 tcp_.listen(port, {this, &amp;Server::on_connect}) \u6ce8\u518c\u8fde\u63a5\u4e8b\u4ef6&#xff0c;\u5e76\u6253\u5370 &#034;Listening on port %u on CPU %d&#034;\u2014\u2014\u8fd9\u6b63\u662f test.py \u4e2d vm.on_output(&#034;Listening on port 8080&#034;, &#8230;) \u7528\u6765\u89e6\u53d1\u5bbf\u4e3b\u7aef\u65ad\u8a00\u7684\u5173\u952e\u65e5\u5fd7\u3002<\/li>\n<li>Response_writer \u662f\u54cd\u5e94\u5199\u5165\u7684\u8f85\u52a9\u5bf9\u8c61&#xff08;response_writer.hpp&#xff09;&#xff1a;header().set_field() \u8bbe\u7f6e\u54cd\u5e94\u5934\u5b57\u6bb5&#xff0c;write(&#034;Hello&#034;) \u5199\u5165\u54cd\u5e94\u4f53&#xff1b;\u6790\u6784\u6216 end() \u65f6\u81ea\u52a8\u5b8c\u6210\u62a5\u6587\u53d1\u9001\u3002<\/li>\n<\/ul>\n<h4>3.2 \u670d\u52a1\u5668\u5e95\u5c42&#xff1a;\u8fde\u63a5\u590d\u7528\u3001\u7a7a\u95f2\u8d85\u65f6\u4e0e\u7edf\u8ba1<\/h4>\n<p>\u670d\u52a1\u5668\u5e76\u975e\u4e00\u4e2a\u7b80\u5355\u7684\u56de\u8c03\u58f3\u3002\u4ece server.cpp \u7684\u5b9e\u73b0\u53ef\u4ee5\u8bfb\u5230\u66f4\u591a\u7ec6\u8282&#xff1a;<\/p>\n<ul>\n<li>\u8fde\u63a5\u7ba1\u7406&#xff1a;connect() \u4f18\u5148\u590d\u7528 free_idx_ \u4e2d\u7a7a\u95f2\u7684\u69fd\u4f4d&#xff0c;\u5426\u5219\u65b0\u5efa Server_connection&#xff0c;\u5e76\u7528 connected_clients() \u7edf\u8ba1\u5728\u7ebf\u8fde\u63a5\u6570\u3002<\/li>\n<li>\u7a7a\u95f2\u8d85\u65f6&#xff1a;\u6784\u9020\u65f6\u53ef\u901a\u8fc7\u7b2c\u4e09\u4e2a\u53c2\u6570\u8bbe\u7f6e idle_duration&#xff08;\u9ed8\u8ba4 DEFAULT_IDLE_TIMEOUT \u4e3a 60 \u79d2&#xff0c;\u89c1 server.cpp&#xff09;&#xff1b;listen() \u4e2d\u82e5\u8d85\u65f6\u4e0d\u4e3a 0&#xff0c;\u4f1a\u6ce8\u518c Timers::periodic(30s, 1min, &#8230;) \u5468\u671f\u6027\u5730\u901a\u8fc7 timeout_clients() \u5173\u95ed\u8d85\u65f6\u8fde\u63a5\u3002<\/li>\n<li>\u8bf7\u6c42\u89e3\u6790&#xff1a;Server_connection::recv_request&#xff08;\u89c1 server_connection.cpp&#xff09;\u628a TCP \u6d41\u6570\u636e\u7d2f\u79ef\u6210 Request&#xff0c;\u82e5\u8bf7\u6c42\u5934\u5e26\u6709 Content-Length \u5219\u6309\u957f\u5ea6\u5224\u5b9a\u8bf7\u6c42\u5b8c\u6210&#xff0c;\u5426\u5219\u7acb\u5373\u7ed3\u675f\u8bf7\u6c42&#xff1b;\u89e3\u6790\u51fa\u9519\u65f6\u4ee5 Bad_Request \u72b6\u6001\u7801\u54cd\u5e94\u3002<\/li>\n<li>\u7edf\u8ba1\u6307\u6807&#xff1a;\u6784\u9020\u51fd\u6570\u901a\u8fc7 Statman \u6ce8\u518c\u4e86 http_server.connections\u3001http_server.requests_rx\u3001http_server.requests_bad\u3001http_server.timeouts \u56db\u4e2a\u7edf\u8ba1\u9879&#xff0c;\u53ef\u5728\u8fd0\u884c\u671f\u901a\u8fc7 statman \u67e5\u8be2\u670d\u52a1\u5668\u5065\u5eb7\u72b6\u6001\u3002<\/li>\n<\/ul>\n<h3>\u56db\u3001\u5ba2\u6237\u7aef\u4ee3\u7801\u5256\u6790&#xff1a;Basic_client \u7684\u8bf7\u6c42\u6784\u9020\u4e0e HTTPS \u9650\u5236<\/h3>\n<h4>4.1 \u53d1\u9001\u524d\u56de\u8c03&#xff1a;\u89c2\u5bdf\u5c06\u8981\u53d1\u51fa\u7684\u8bf7\u6c42<\/h4>\n<p>client_ &#061; std::make_unique&lt;Basic_client&gt;(inet.tcp());<br \/>\nclient_-&gt;on_send([] (Request&amp; req, Basic_client::Options&amp; opt, const Basic_client::Host host)<br \/>\n{<br \/>\n  printf(&#034;Sending request:\\\\n%s\\\\n&#034;, req.to_string().c_str());<br \/>\n});<\/p>\n<p>on_send \u56de\u8c03\u5728\u8bf7\u6c42\u771f\u6b63\u5199\u5165 TCP \u6d41\u4e4b\u524d\u88ab\u8c03\u7528&#xff08;\u89c1 basic_client.cpp \u4e2d send() \u5185 if(on_send_) on_send_(*req, options, host);&#xff09;&#xff0c;\u9002\u5408\u8c03\u8bd5\u6216\u4fee\u6539\u81ea\u52a8\u751f\u6210\u7684\u8bf7\u6c42\u3002<\/p>\n<h4>4.2 HTTPS \u4e0d\u652f\u6301&#xff1a;\u671f\u671b\u629b\u51fa\u5f02\u5e38<\/h4>\n<p>INFO(&#034;Basic_client&#034;, &#034;HTTPS&#034;);<\/p>\n<p>try<br \/>\n{<br \/>\n  client_-&gt;get(&#034;https:\/\/www.google.com&#034;, {}, [](Error err, Response_ptr res, Connection&amp;) {});<br \/>\n  assert(false &amp;&amp; &#034;Basic Client should throw exception&#034;);<br \/>\n}<br \/>\ncatch(const http::Client_error&amp; err)<br \/>\n{<br \/>\n  CHECKSERT(true, &#034;Basic Client should throw exception on https URL&#034;);<br \/>\n}<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5f88\u6709\u610f\u601d\u7684\u8d1f\u5411\u6d4b\u8bd5&#xff1a;Basic_client \u6784\u9020\u51fd\u6570\u4f20\u5165\u7684 https_supported \u6807\u5fd7\u4e3a false&#xff08;\u89c1 basic_client.cpp&#xff09;&#xff0c;\u56e0\u6b64\u5f53 URL \u7684 scheme \u4e3a https \u65f6&#xff0c;validate_secure() \u4f1a\u629b\u51fa Client_error{&#034;Secured connections not supported (use the HTTPS Client).&#034;}&#xff08;\u89c1 basic_client.hpp&#xff09;\u3002CHECKSERT \u5b8f&#xff08;\u5b9a\u4e49\u4e8e api\/info&#xff0c;\u5373 CHECK(&#8230;) &#043; assert(&#8230;)&#xff09;\u5728\u6253\u5370 [x] \u901a\u8fc7\u6807\u8bb0\u7684\u540c\u65f6\u6267\u884c\u65ad\u8a00&#xff0c;\u786e\u8ba4\u5f02\u5e38\u786e\u5b9e\u88ab\u629b\u51fa\u3002<\/p>\n<p>\u82e5\u9700\u8981 HTTPS \u5ba2\u6237\u7aef&#xff0c;\u4ed3\u5e93\u63d0\u4f9b\u4e86\u7ee7\u627f\u81ea Basic_client \u7684 http::Client&#xff08;\u89c1 client.cpp&#xff09;&#xff0c;\u5b83\u5728 get_secure_connection() \u4e2d\u901a\u8fc7 openssl::TLS_stream \u5efa\u7acb TLS \u8fde\u63a5\u3002\u6d4b\u8bd5\u8fd9\u91cc\u523b\u610f\u9a8c\u8bc1\u7684\u662f&#034;\u666e\u901a\u5ba2\u6237\u7aef\u5fc5\u987b\u62d2\u7edd https&#034;&#xff0c;\u5c5e\u4e8e API \u5951\u7ea6\u6d4b\u8bd5\u3002<\/p>\n<h4>4.3 \u6b63\u5411\u5f80\u672c\u5730\u670d\u52a1\u5668\u53d1\u8d77\u8bf7\u6c42<\/h4>\n<p>auto req &#061; client_-&gt;create_request();<\/p>\n<p>req-&gt;set_uri(uri::URI{&#034;\/testing&#034;});<br \/>\nclient_-&gt;send(std::move(req), {inet.gateway(), 9011},<br \/>\n[] (Error err, Response_ptr res, Connection&amp;)<br \/>\n{<br \/>\n  if (err)<br \/>\n    printf(&#034;Error: %s \\\\n&#034;, err.to_string().c_str());<\/p>\n<p>  CHECKSERT(!err, &#034;No error&#034;);<br \/>\n  printf(&#034;Received body: %.*s\\\\n&#034;, static_cast&lt;int&gt;(res-&gt;body().length()), res-&gt;body().data());<br \/>\n  CHECKSERT(res-&gt;body() &#061;&#061; &#034;\/testing&#034;, &#034;Received body: \\\\&#034;\/testing\\\\&#034;&#034;);<\/p>\n<p>  printf(&#034;SUCCESS\\\\n&#034;);<br \/>\n});<\/p>\n<p>\u8fd9\u4e00\u6bb5\u7684\u5b8c\u6574\u8c03\u7528\u94fe\u4f53\u73b0\u4e86 Basic_client \u7684\u8bbe\u8ba1&#xff1a;<\/p>\n<li>create_request()&#xff08;\u9ed8\u8ba4 GET&#xff09;\u4f1a\u9884\u586b User-Agent: IncludeOS\/0.12 \u4ee5\u53ca Connection \u5934&#xff08;\u9ed8\u8ba4 close&#xff09;&#xff0c;\u89c1 basic_client.cpp\u3002\u6d4b\u8bd5\u4e2d\u4ec5\u8986\u76d6\u4e86 create_request() \u914d\u5408 send() \u7684\u7528\u6cd5&#xff1b;\u5b9e\u9645\u4e0a\u5ba2\u6237\u7aef\u8fd8\u63d0\u4f9b get\/post\/request \u7b49\u4fbf\u6377\u65b9\u6cd5&#xff0c;\u5e76\u652f\u6301\u4ee5 URI \u6216 (Host, path) \u4e24\u79cd\u65b9\u5f0f\u5b9a\u4f4d\u76ee\u6807\u3002<\/li>\n<li>send(Request_ptr, Host, Response_handler, secure&#061;false, Options&#061;{})&#xff1a;\u5411\u6307\u5b9a\u4e3b\u673a\u53d1\u9001\u8bf7\u6c42\u3002\u5b9e\u73b0\u4e2d\u4f1a\u81ea\u52a8\u8865\u9f50 Host \u4e0e Origin \u5934&#xff08;Origin \u5373\u672c\u673a IP&#xff0c;\u89c1 origin()&#xff09;&#xff0c;\u518d\u8c03\u7528 Client_connection::send \u5b8c\u6210\u53d1\u9001\u3002<\/li>\n<li>\u56de\u8c03\u4e0e\u9519\u8bef&#xff1a;\u54cd\u5e94\u56de\u8c03\u7b7e\u540d\u662f delegate&lt;void(Error, Response_ptr, Connection&amp;)&gt;\u3002Error&#xff08;\u89c1 error.hpp&#xff09;\u662f\u4e00\u4e2a\u8f7b\u91cf\u9519\u8bef\u5c01\u88c5&#xff0c;\u679a\u4e3e\u5305\u62ec NONE \/ RESOLVE_HOST \/ NO_REPLY \/ INVALID \/ TIMEOUT \/ CLOSING&#xff0c;\u53ef\u7528 to_string() \u8f93\u51fa\u4eba\u7c7b\u53ef\u8bfb\u4fe1\u606f&#xff0c;operator bool \u7528\u4e8e if (err) \u5224\u65ad\u3002\u56de\u8c03\u4e2d !err \u8868\u793a\u6210\u529f\u6536\u5230\u54cd\u5e94&#xff0c;res-&gt;body() \u8fd4\u56de\u54cd\u5e94\u4f53&#xff0c;\u6d4b\u8bd5\u65ad\u8a00\u5176\u4e0e\u8bf7\u6c42\u8def\u5f84 \/testing \u4e00\u81f4\u3002<\/li>\n<h4>4.4 \u5ba2\u6237\u7aef\u5e95\u5c42&#xff1a;\u8fde\u63a5\u590d\u7528\u3001\u8d85\u65f6\u4e0e\u91cd\u5b9a\u5411<\/h4>\n<p>\u4ece client_connection.cpp \u53ef\u4ee5\u770b\u5230\u5ba2\u6237\u7aef\u8fde\u63a5\u7684\u6838\u5fc3\u673a\u5236&#xff1a;<\/p>\n<ul>\n<li>\u8fde\u63a5\u590d\u7528&#xff1a;Basic_client \u5185\u90e8\u4ee5 Connection_mapset &#061; std::map&lt;Host, Connection_set&gt; \u6309\u76ee\u6807\u4e3b\u673a\u7f13\u5b58\u8fde\u63a5&#xff1b;get_connection() \u4f18\u5148\u590d\u7528\u672a\u5360\u7528\u7684\u7a7a\u95f2\u8fde\u63a5&#xff0c;\u5426\u5219\u65b0\u5efa TCP \u8fde\u63a5&#xff08;\u89c1 basic_client.cpp&#xff09;\u3002\u8fde\u63a5\u7684\u53ef\u7528\u6027\u7531 available()&#xff08;on_response_ &#061;&#061; nullptr &amp;&amp; keep_alive_&#xff09;\u51b3\u5b9a&#xff0c;\u800c keep_alive_ \u53d6\u51b3\u4e8e\u8bf7\u6c42\u5934 Connection \u662f\u5426\u4e3a close\u3002<\/li>\n<li>\u54cd\u5e94\u63a5\u6536&#xff1a;recv_response \u628a TCP \u5206\u7247\u9010\u6b65\u62fc\u88c5\u6210 Response&#xff0c;\u6309 Content-Length \u5224\u65ad\u62a5\u6587\u662f\u5426\u5b8c\u6574&#xff1b;\u5bf9\u4e8e 1xx\/204\/304 \u4ee5\u53ca HEAD \u8bf7\u6c42\u7b49&#034;\u65e0\u5b9e\u4f53&#034;\u54cd\u5e94&#xff0c;\u6536\u5230\u7a7a\u884c\u5373\u7ed3\u675f\u3002<\/li>\n<li>\u8d85\u65f6\u63a7\u5236&#xff1a;Options.timeout \u9ed8\u8ba4 DEFAULT_TIMEOUT \u4e3a 5 \u79d2&#xff08;\u89c1 basic_client.cpp&#xff09;&#xff0c;\u8d85\u65f6\u540e\u56de\u8c03\u6536\u5230 Error::TIMEOUT\u3002<\/li>\n<li>\u91cd\u5b9a\u5411&#xff1a;Options.follow_redirect \u9ed8\u8ba4 0&#xff08;\u4e0d\u8ddf\u968f&#xff09;&#xff1b;\u82e5\u5927\u4e8e 0&#xff0c;\u6536\u5230 3xx \u4e14\u5e26 Location \u7684\u54cd\u5e94\u65f6&#xff0c;Client_connection::redirect \u4f1a\u66f4\u65b0 URI \u5e76\u91cd\u65b0\u53d1\u9001\u8bf7\u6c42&#xff08;\u89c1 client_connection.cpp&#xff09;\u3002<\/li>\n<li>\u5173\u95ed\u8bed\u4e49&#xff1a;\u8fde\u63a5\u88ab\u5bf9\u7aef\u5173\u95ed\u65f6&#xff0c;\u82e5\u5df2\u6536\u5230\u5b8c\u6574\u54cd\u5e94\u5934\u5219\u56de\u8c03 Error::NONE&#xff0c;\u5426\u5219\u56de\u8c03 Error::CLOSING\u3002<\/li>\n<\/ul>\n<h3>\u4e94\u3001\u5bbf\u4e3b\u7aef\u6d4b\u8bd5\u9a71\u52a8&#xff1a;Python \u56de\u663e\u670d\u52a1\u5668\u4e0e vmrunner<\/h3>\n<p>test.py \u662f\u8fd0\u884c\u5728\u5bbf\u4e3b Linux \u4e0a\u7684 Python 3 \u811a\u672c&#xff0c;\u5b83\u540c\u65f6\u627f\u62c5\u4e24\u4e2a\u89d2\u8272\u3002<\/p>\n<h4>5.1 \u89d2\u8272\u4e00&#xff1a;9011 \u7aef\u53e3\u7684\u56de\u663e HTTP \u670d\u52a1\u5668<\/h4>\n<p>HOST &#061; &#039;&#039;<br \/>\nPORT &#061; 9011<\/p>\n<p>class RequestHandler(http.server.BaseHTTPRequestHandler):<br \/>\n    def do_GET(s):<br \/>\n        s.send_response(200)<br \/>\n        s.send_header(&#034;Content-type&#034;, &#034;text\/plain; charset&#061;utf-8&#034;,)<br \/>\n        s.end_headers()<br \/>\n        s.wfile.write(s.path.encode(&#034;utf-8&#034;))<\/p>\n<p>def Client_test():<br \/>\n    server_class &#061; http.server.HTTPServer<br \/>\n    httpd &#061; server_class((HOST, PORT), RequestHandler)<br \/>\n    global DO_SERVE<br \/>\n    while(DO_SERVE):<br \/>\n        httpd.handle_request()<br \/>\n        DO_SERVE &#061; False<br \/>\n    httpd.server_close()<\/p>\n<p># Start web server in a separate thread<br \/>\n_thread.start_new_thread(Client_test, ())<\/p>\n<p>\u8fd9\u6bb5\u903b\u8f91\u8bbe\u8ba1\u5f97\u975e\u5e38\u7cbe\u5999&#xff1a;\u5bbf\u4e3b\u673a\u5728 10.0.0.1:9011 \u8d77\u4e00\u4e2a\u53ea\u5904\u7406\u4e00\u6b21\u8bf7\u6c42\u7684 HTTP \u670d\u52a1\u5668&#xff0c;do_GET \u76f4\u63a5\u628a\u8bf7\u6c42\u8def\u5f84\u4f5c\u4e3a\u54cd\u5e94\u4f53\u8fd4\u56de&#xff08;\u8bf7\u6c42 \/testing \u5c31\u56de testing&#xff09;\u3002VM \u5185\u5ba2\u6237\u7aef\u6070\u597d\u53d1\u9001 URI \u4e3a \/testing \u7684\u8bf7\u6c42\u5230 {inet.gateway(), 9011}\u2014\u2014\u7f51\u5173\u5c31\u662f\u5bbf\u4e3b\u673a\u2014\u2014\u56e0\u6b64\u5ba2\u6237\u7aef\u56de\u8c03\u65ad\u8a00 res-&gt;body() &#061;&#061; &#034;\/testing&#034; \u65f6&#xff0c;\u5b9e\u9645\u4e0a\u540c\u65f6\u9a8c\u8bc1\u4e86\u6865\u63a5\u7f51\u7edc\u8fde\u901a\u6027 &#043; TCP \u8fde\u63a5 &#043; HTTP \u8bf7\u6c42\u6784\u9020 &#043; \u54cd\u5e94\u89e3\u6790\u56db\u5c42\u94fe\u8def\u3002\u8fd9\u91cc\u5c31\u662f\u539f\u6587\u6863&#034;Outgoing test requires correct network configuration&#034;\u6240\u6307\u7684\u73af\u8282&#xff1a;\u82e5\u5bbf\u4e3b\u673a\u4e0e VM \u4e4b\u95f4\u6ca1\u6709\u6b63\u786e\u6865\u63a5&#xff08;run.sh \u4e2d create_bridge.sh \u7684\u804c\u8d23&#xff09;&#xff0c;\u8bf7\u6c42\u5c06\u6c38\u8fdc\u5230\u8fbe\u4e0d\u4e86 9011 \u7aef\u53e3\u3002<\/p>\n<h4>5.2 \u89d2\u8272\u4e8c&#xff1a;vmrunner \u9a71\u52a8\u7684\u65ad\u8a00\u811a\u672c<\/h4>\n<p>def Server_test(triggerline):<br \/>\n    res &#061; urllib.request.urlopen(&#034;http:\/\/10.0.0.46:8080&#034;).read()<br \/>\n    assert(res.decode(&#039;utf-8&#039;) &#061;&#061; &#034;Hello&#034;)<\/p>\n<p># Get an auto-created VM from the vmrunner<br \/>\nvm &#061; vmrunner.vms[0]<\/p>\n<p># Add custom event for testing server<br \/>\nvm.on_output(&#034;Listening on port 8080&#034;, Server_test)<\/p>\n<p>if len(sys.argv) &gt; 1:<br \/>\n    vm.boot(image_name&#061;str(sys.argv[1]))<br \/>\nelse:<br \/>\n    # Boot the VM, taking a timeout as parameter<br \/>\n    vm.boot(20,image_name&#061;&#039;net_http.elf.bin&#039;)<\/p>\n<p>Server_test \u5728 VM \u8f93\u51fa Listening on port 8080 \u7684\u90a3\u4e00\u523b\u89e6\u53d1&#xff0c;\u7528\u6807\u51c6\u5e93 urllib \u5411 VM \u7684 8080 \u7aef\u53e3\u53d1\u8d77 GET&#xff0c;\u65ad\u8a00\u54cd\u5e94\u4f53\u4e3a Hello\u2014\u2014\u4e0e service.cpp \u4e2d writer-&gt;write(&#034;Hello&#034;) \u4e00\u4e00\u5bf9\u5e94\u3002\u8fd9\u9a8c\u8bc1\u4e86\u670d\u52a1\u7aef\u65b9\u5411&#xff1a;\u5916\u90e8\u5ba2\u6237\u7aef\u80fd\u8bbf\u95ee\u5230 unikernel \u5185\u7684 HTTP \u670d\u52a1\u5668&#xff0c;\u5e76\u6536\u5230\u6b63\u786e\u7684\u54cd\u5e94\u3002<\/p>\n<p>vm.boot(20, &#8230;) \u8868\u793a\u4ee5 20 \u79d2\u8d85\u65f6\u542f\u52a8 VM&#xff08;\u82e5\u547d\u4ee4\u884c\u4f20\u5165\u955c\u50cf\u53c2\u6570\u5219\u4ee5\u53c2\u6570\u4e3a\u51c6&#xff09;&#xff0c;\u6574\u4e2a\u6d4b\u8bd5\u811a\u672c\u6700\u7ec8\u901a\u8fc7 exit \u72b6\u6001\u7801\u5411 CI \u6c47\u62a5\u6210\u8d25\u3002<\/p>\n<h3>\u516d\u3001\u8fd0\u884c\u65b9\u5f0f\u4e0e\u51fa\u7ad9\u7f51\u7edc\u914d\u7f6e<\/h3>\n<p>run.sh \u63d0\u4f9b\u4e86\u6807\u51c6\u542f\u52a8\u6d41\u7a0b&#xff1a;<\/p>\n<p>#! \/bin\/bash<br \/>\nset &#8211;<br \/>\nINCLUDEOS_PREFIX&#061;${INCLUDEOS_PREFIX-\/usr\/local}<br \/>\nsudo $INCLUDEOS_PREFIX\/includeos\/scripts\/create_bridge.sh<\/p>\n<p>FILE&#061;$1<br \/>\nshift<br \/>\nsource $INCLUDEOS_PREFIX\/includeos\/scripts\/run.sh $FILE ${*}<\/p>\n<p>\u6267\u884c\u6b65\u9aa4&#xff1a;<\/p>\n<li>\u82e5\u672a\u8bbe\u7f6e INCLUDEOS_PREFIX&#xff0c;\u9ed8\u8ba4\u53d6 \/usr\/local&#xff1b;<\/li>\n<li>create_bridge.sh \u5728\u5bbf\u4e3b\u673a\u4e0a\u521b\u5efa\u6865\u63a5\u7f51\u5361&#xff08;\u9700 sudo&#xff09;&#xff0c;\u4f7f VM \u7684 virtio \u7f51\u5361\u80fd\u63a5\u5165 10.0.0.0\/24 \u7f51\u6bb5\u3001\u5e76\u53ef\u901a\u8fc7\u7f51\u5173 10.0.0.1 \u4e0e\u5bbf\u4e3b\u673a\u4e92\u901a&#xff1b;<\/li>\n<li>source run.sh &lt;\u955c\u50cf\u6587\u4ef6&gt; \u7528 QEMU \u542f\u52a8 net_http.elf.bin\u3002<\/li>\n<h4>6.1 \u4e24\u79cd\u6d4b\u8bd5\u65b9\u5411\u7684\u7f51\u7edc\u8981\u6c42<\/h4>\n<table>\n<tr>\u6d4b\u8bd5\u65b9\u5411\u7f51\u7edc\u4f9d\u8d56\u5931\u8d25\u8868\u73b0<\/tr>\n<tbody>\n<tr>\n<td>\u670d\u52a1\u7aef\u6d4b\u8bd5&#xff08;\u5bbf\u4e3b\u673a\u8bbf\u95ee VM:8080&#xff09;<\/td>\n<td>VM \u4e0e\u5bbf\u4e3b\u673a\u6865\u63a5\u4e92\u901a\u5373\u53ef&#xff0c;\u65e0\u9700\u5916\u7f51<\/td>\n<td>urllib \u8fde\u63a5\u8d85\u65f6&#xff0c;assert \u5931\u8d25<\/td>\n<\/tr>\n<tr>\n<td>\u5ba2\u6237\u7aef\u51fa\u7ad9\u6d4b\u8bd5&#xff08;VM \u8bbf\u95ee\u5bbf\u4e3b\u673a:9011&#xff09;<\/td>\n<td>\u6865\u63a5\u4e92\u901a &#043; \u5bbf\u4e3b\u673a 9011 \u7aef\u53e3\u53ef\u88ab VM \u8bbf\u95ee<\/td>\n<td>\u5ba2\u6237\u7aef\u56de\u8c03\u6536\u5230\u9519\u8bef&#xff0c;CHECKSERT(!err) \u5931\u8d25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u539f\u6587\u6863\u7684&#034;\u51fa\u7ad9\u6d4b\u8bd5\u9700\u8981\u6b63\u786e\u7684\u7f51\u7edc\u914d\u7f6e&#034;\u6b63\u662f\u9488\u5bf9\u7b2c\u4e8c\u884c&#xff1a;VM \u5185\u7684 TCP \u8fde\u63a5\u8981\u5230\u8fbe\u5bbf\u4e3b\u673a\u76d1\u542c\u7aef\u53e3&#xff0c;\u9664\u6865\u63a5\u5916\u8fd8\u8981\u6c42\u5bbf\u4e3b\u673a\u4fa7\u9632\u706b\u5899\/\u8def\u7531\u5141\u8bb8\u8be5\u6d41\u91cf&#xff1b;\u82e5\u8981\u8bbf\u95ee\u5916\u7f51&#xff08;\u5982\u67d0\u4e9b\u6d4b\u8bd5\u8bbf\u95ee\u771f\u5b9e\u516c\u7f51\u670d\u52a1&#xff09;&#xff0c;\u8fd8\u9700\u914d\u7f6e NAT \u6216\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219\u3002\u672c\u6d4b\u8bd5\u7528&#034;\u5bbf\u4e3b\u673a\u56de\u663e\u670d\u52a1\u5668&#034;\u66ff\u4ee3\u5916\u7f51\u76ee\u6807&#xff0c;\u628a\u5916\u90e8\u4f9d\u8d56\u964d\u5230\u6700\u4f4e&#xff0c;\u8fd9\u662f\u5b83\u9002\u5408\u4f5c\u4e3a CI \u56de\u5f52\u6d4b\u8bd5\u7684\u91cd\u8981\u539f\u56e0\u3002<\/p>\n<h3>\u4e03\u3001\u6d4b\u8bd5\u9884\u671f\u8f93\u51fa\u4e0e\u7ed3\u679c\u5224\u5b9a<\/h3>\n<p>\u6574\u4e2a\u6d4b\u8bd5\u6210\u529f\u65f6&#xff0c;\u65e5\u5fd7\u94fe\u8def\u5927\u81f4\u5982\u4e0b&#xff08;\u6309\u65f6\u95f4\u987a\u5e8f&#xff09;&#xff1a;<\/p>\n<p>[ HTTP Server ] Listening on port 8080 on CPU 0      \u2190 VM \u670d\u52a1\u7aef\u5c31\u7eea&#xff0c;\u89e6\u53d1 Server_test<br \/>\n[ Basic_client ] Testing against local server        \u2190 \u5ba2\u6237\u7aef\u5f00\u59cb\u51fa\u7ad9\u8bf7\u6c42<br \/>\nSending request:                                     \u2190 on_send \u56de\u8c03\u6253\u5370<br \/>\nGET \/testing HTTP\/1.1<br \/>\nHost: 10.0.0.1:9011<br \/>\n&#8230;<br \/>\nReceived body: \/testing                              \u2190 \u56de\u8c03\u6536\u5230\u56de\u663e<br \/>\nSUCCESS                                              \u2190 \u5ba2\u6237\u7aef\u6d4b\u8bd5\u901a\u8fc7<\/p>\n<p>\u82e5\u67d0\u4e2a\u73af\u8282\u5931\u8d25&#xff1a;<\/p>\n<ul>\n<li>CHECKSERT(!err, &#034;No error&#034;) \u5931\u8d25\u8bf4\u660e\u51fa\u7ad9\u8bf7\u6c42\u51fa\u9519&#xff0c;\u53ef\u7ed3\u5408 Error::to_string() \u5b9a\u4f4d&#xff08;Unable to resolve host \/ No reply \/ Request timed out \u7b49&#xff09;&#xff1b;<\/li>\n<li>CHECKSERT(res-&gt;body() &#061;&#061; &#034;\/testing&#034;, &#8230;) \u5931\u8d25\u8bf4\u660e\u54cd\u5e94\u5185\u5bb9\u5f02\u5e38&#xff0c;\u901a\u5e38\u662f\u5bbf\u4e3b\u673a\u56de\u663e\u670d\u52a1\u5668\u884c\u4e3a\u4e0e\u9884\u671f\u4e0d\u7b26&#xff1b;<\/li>\n<li>\u670d\u52a1\u7aef\u65b9\u5411\u7684 assert(res.decode(&#039;utf-8&#039;) &#061;&#061; &#034;Hello&#034;) \u5931\u8d25\u8bf4\u660e 8080 \u7aef\u53e3\u54cd\u5e94\u4f53\u9519\u8bef\u3002<\/li>\n<\/ul>\n<p>\u7531\u4e8e CHECKSERT \u5b8f\u5728\u6253\u5370 [ ] \u5931\u8d25\u6807\u8bb0\u540e\u4f1a\u89e6\u53d1 assert&#xff08;\u89c1 api\/info&#xff09;&#xff0c;VM \u4f1a\u4e2d\u6b62\u8fd0\u884c&#xff0c;vmrunner \u968f\u4e4b\u5224\u5b9a\u6d4b\u8bd5\u5931\u8d25\u2014\u2014\u8fd9\u6b63\u662f\u96c6\u6210\u6d4b\u8bd5&#034;\u65ad\u8a00\u5373\u54e8\u5175&#034;\u7684\u8bbe\u8ba1\u601d\u8def\u3002<\/p>\n<h3>\u516b\u3001\u5c0f\u7ed3&#xff1a;\u4ece\u6d4b\u8bd5\u6587\u6863\u5230\u6e90\u7801\u5951\u7ea6<\/h3>\n<p>\u5c3d\u7ba1\u539f README \u53ea\u6709\u5be5\u5be5\u6570\u8bed&#xff0c;\u4f46 test\/integration\/net\/http\/ \u76ee\u5f55\u5b9e\u9645\u4e0a\u6d53\u7f29\u4e86 IncludeOS HTTP \u6808\u6700\u91cd\u8981\u7684\u4e24\u6761\u4f7f\u7528\u8def\u5f84&#xff1a;<\/p>\n<ul>\n<li>\u670d\u52a1\u7aef&#xff1a;Server &#043; on_request \u56de\u8c03 &#043; Response_writer&#xff0c;\u914d\u5408\u8fde\u63a5\u590d\u7528\u3001\u7a7a\u95f2\u8d85\u65f6\u4e0e Statman \u7edf\u8ba1&#xff0c;\u89c1 server.hpp \u4e0e server.cpp&#xff1b;<\/li>\n<li>\u5ba2\u6237\u7aef&#xff1a;Basic_client \u7684\u8bf7\u6c42\u6784\u9020\u3001\u8fde\u63a5\u7f13\u5b58\u3001\u8d85\u65f6\/\u91cd\u5b9a\u5411\u4e0e\u9519\u8bef\u6a21\u578b&#xff0c;\u4ee5\u53ca&#034;\u4e0d\u652f\u6301 HTTPS \u5fc5\u987b\u629b\u5f02\u5e38&#034;\u7684 API \u5951\u7ea6&#xff0c;\u89c1 basic_client.hpp \u4e0e basic_client.cpp\u3002<\/li>\n<\/ul>\n<p>\u5bf9\u60f3\u8981\u5728 IncludeOS \u4e0a\u5f00\u53d1 HTTP \u670d\u52a1\u7684\u5f00\u53d1\u8005\u800c\u8a00&#xff0c;\u8fd9\u5957\u6d4b\u8bd5\u5c31\u662f\u73b0\u6210\u7684&#034;\u6700\u5c0f\u53ef\u8fd0\u884c\u8303\u4f8b&#034;&#xff1a;\u7167\u6284 service.cpp \u7684\u670d\u52a1\u5668\u4e09\u6bb5\u5f0f&#xff08;\u521b\u5efa Server \u2192 \u6ce8\u518c\u56de\u8c03 \u2192 listen&#xff09;&#xff0c;\u518d\u914d\u5408 CMakeLists.txt \u7684\u6784\u5efa\u811a\u624b\u67b6&#xff0c;\u5373\u53ef\u5feb\u901f\u4ea7\u51fa\u81ea\u5df1\u7684 HTTP \u670d\u52a1\u955c\u50cf&#xff1b;\u800c\u5ba2\u6237\u7aef\u7684 create_request \/ get \/ post \/ send \/ on_send \u7ec4\u5408&#xff0c;\u5219\u8986\u76d6\u4e86\u5728 unikernel \u5185\u4e3b\u52a8\u53d1\u8d77 HTTP \u8bf7\u6c42\u7684\u5168\u90e8\u5e38\u89c1\u573a\u666f\u3002\u8fd0\u884c\u6d4b\u8bd5\u524d&#xff0c;\u52a1\u5fc5\u50cf\u539f\u6587\u6863\u63d0\u9192\u7684\u90a3\u6837\u786e\u8ba4\u6865\u63a5\u4e0e\u51fa\u7ad9\u7f51\u7edc\u914d\u7f6e\u6b63\u786e\u2014\u2014\u8fd9\u662f\u6574\u5957\u94fe\u8def\u80fd\u591f\u8dd1\u901a\u7684\u524d\u63d0\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020114038-6ad753360ebe5.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u64cd\u4f5c\u7cfb\u7edf<\/span><\/li>\n<li><span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><\/li>\n<li><span class=\"gcb-tag\">\u865a\u62df\u5316<\/span><\/li>\n<li><span class=\"gcb-tag\">\u7f51\u7edc<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011IncludeOS<\/h3>\n<p class=\"gcb-project-desc\">A minimal, resource efficient unikernel for cloud services<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/in\/IncludeOS<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\"> Guzzle HTTP\u5ba2\u6237\u7aef\u6d4b\u8bd5\u6307\u5357&#xff1a;Mock\u4e0e\u6d4b\u8bd5\u670d\u52a1\u5668\u5b9e\u6218<\/h5>\n<p class=\"gcb-related-item-desc\">Guzzle HTTP\u5ba2\u6237\u7aef\u6d4b\u8bd5\u6307\u5357&#xff1a;Mock\u4e0e\u6d4b\u8bd5\u670d\u52a1\u5668\u5b9e\u6218 \u4e3a\u4ec0\u4e48\u9700\u8981\u6d4b\u8bd5HTTP\u5ba2\u6237\u7aef \u5728\u73b0\u4ee3\u5e94\u7528\u5f00\u53d1\u4e2d&#xff0c;HTTP\u5ba2\u6237\u7aef\u4f5c\u4e3a\u4e0e\u5916\u90e8\u670d\u52a1\u4ea4\u4e92\u7684\u6865\u6881&#xff0c;\u5176\u7a33\u5b9a\u6027<\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">gRPC HTTP\/2 Interop \u6d4b\u8bd5\u5957\u4ef6\u5b9e\u6218\u6307\u5357&#xff1a;\u7528 Go \u9a8c\u8bc1\u670d\u52a1\u5668\u4e0e HTTP\/2 \u5ba2\u6237\u7aef\u7684\u4e92\u64cd\u4f5c\u6027<\/h5>\n<p class=\"gcb-related-item-desc\">gRPC HTTP\/2 Interop \u6d4b\u8bd5\u5957\u4ef6\u5b9e\u6218\u6307\u5357&#xff1a;\u7528 Go \u9a8c\u8bc1\u670d\u52a1\u5668\u4e0e HTTP\/2 \u5ba2\u6237\u7aef\u7684\u4e92\u64cd\u4f5c\u6027 \u5bfc\u8bfb \u672c\u6307\u5357\u56f4\u7ed5 gRPC \u4ed3\u5e93\u4e2d\u7684 tool<\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span><br \/>\n     <span class=\"gcb-tag\">RPC\u6846\u67b6<\/span><br \/>\n     <span class=\"gcb-tag\">\u5fae\u670d\u52a1<\/span><br \/>\n     <span class=\"gcb-tag\">\u901a\u4fe1<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\"> IncludeOS\u5b9e\u6218&#xff1a;\u6784\u5efa\u9ad8\u6027\u80fdHTTP\/HTTPS\u670d\u52a1\u5668<\/h5>\n<p class=\"gcb-related-item-desc\">IncludeOS\u5b9e\u6218&#xff1a;\u6784\u5efa\u9ad8\u6027\u80fdHTTP\/HTTPS\u670d\u52a1\u5668 \u5728\u4e91\u8ba1\u7b97\u65f6\u4ee3&#xff0c; IncludeOS \u4f5c\u4e3a\u4e00\u4e2a\u9769\u547d\u6027\u7684 unikernel \u64cd\u4f5c\u7cfb\u7edf&#xff0c;\u4e3a\u6784\u5efa \u9ad8\u6027\u80fd<\/p>\n<p>     <span class=\"gcb-tag\">\u64cd\u4f5c\u7cfb\u7edf<\/span><br \/>\n     <span class=\"gcb-tag\">\u4e91\u539f\u751f<\/span><br \/>\n     <span class=\"gcb-tag\">\u865a\u62df\u5316<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f51\u7edc<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  3\u5206\u949f\u638c\u63e1DeepSeek-V4-Flash-DSpark\u7f16\u7801\u6280\u5de7&#xff1a;\u4ece\u6d88\u606f\u683c\u5f0f\u5230\u5de5\u5177\u8c03\u7528\u5168\u653b\u7565 <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  Sequin\u5f00\u53d1\u6307\u5357&#xff1a;\u5982\u4f55\u4e3a\u8fd9\u4e2aANSI\u89e3\u6790\u5de5\u5177\u8d21\u732e\u4ee3\u7801 <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u64cd\u4f5c\u7cfb\u7edf\u4e91\u539f\u751f\u865a\u62df\u5316\u7f51\u7edc \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011IncludeOS A minimal, resource efficient unikernel for cloud services \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/in\/IncludeOS \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d  \u5bfc\u8bfb<br \/>\n\u672c\u6587\u56f4\u7ed5 test\/integration\/net\/http\/README.md \u6240\u63cf\u8ff0\u7684 HTTP \u96c6\u6210\u6d4b\u8bd5\u5c55\u5f00&#xff0c;\u6df1\u5165\u8bb2\u89e3 IncludeO<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-116132","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/116132.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u64cd\u4f5c\u7cfb\u7edf\u4e91\u539f\u751f\u865a\u62df\u5316\u7f51\u7edc \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011IncludeOS A minimal, resource efficient unikernel for cloud services \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/in\/IncludeOS \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb \u672c\u6587\u56f4\u7ed5 test\/integration\/net\/http\/README.md \u6240\u63cf\u8ff0\u7684 HTTP \u96c6\u6210\u6d4b\u8bd5\u5c55\u5f00&#xff0c;\u6df1\u5165\u8bb2\u89e3 IncludeO\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/116132.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-20T11:40:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020114038-6ad753360ebe5.svg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116132.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/116132.html\",\"name\":\"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-20T11:40:39+00:00\",\"dateModified\":\"2026-10-20T11:40:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/116132.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/116132.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/116132.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/116132.html","og_locale":"zh_CN","og_type":"article","og_title":"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u64cd\u4f5c\u7cfb\u7edf\u4e91\u539f\u751f\u865a\u62df\u5316\u7f51\u7edc \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011IncludeOS A minimal, resource efficient unikernel for cloud services \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/gh_mirrors\/in\/IncludeOS \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u5bfc\u8bfb \u672c\u6587\u56f4\u7ed5 test\/integration\/net\/http\/README.md \u6240\u63cf\u8ff0\u7684 HTTP \u96c6\u6210\u6d4b\u8bd5\u5c55\u5f00&#xff0c;\u6df1\u5165\u8bb2\u89e3 IncludeO","og_url":"https:\/\/www.wsisp.com\/helps\/116132.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-20T11:40:39+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261020114038-6ad753360ebe5.svg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/116132.html","url":"https:\/\/www.wsisp.com\/helps\/116132.html","name":"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-20T11:40:39+00:00","dateModified":"2026-10-20T11:40:39+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/116132.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/116132.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/116132.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"IncludeOS HTTP \u96c6\u6210\u6d4b\u8bd5\u5b9e\u6218\uff1a\u5728\u672c\u5730\u670d\u52a1\u5668\u4e0a\u9a8c\u8bc1 HTTP \u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=116132"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/116132\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=116132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=116132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=116132"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=116132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}