From 44f86355fde9b39a70710ffdad9ca2dab4dc4413 Mon Sep 17 00:00:00 2001 From: shan <2434909991@qq.com> Date: Sun, 19 Feb 2023 13:30:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?http=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...41\345\235\227\350\257\273\345\206\231.md" | 0 .../20230217-http\346\250\241\345\235\227.md" | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+) rename "20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" => "\345\262\221\345\234\243\345\261\261/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" (100%) create mode 100644 "\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" diff --git "a/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" "b/\345\262\221\345\234\243\345\261\261/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" similarity index 100% rename from "20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" rename to "\345\262\221\345\234\243\345\261\261/20230216-\346\250\241\345\235\227\350\257\273\345\206\231.md" diff --git "a/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" "b/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" new file mode 100644 index 0000000..1f806f9 --- /dev/null +++ "b/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" @@ -0,0 +1,27 @@ +## http模块 + +1、http协议 为请求/响应式的协议 +2、http协议常见方法有:get、post、put、delete、options +3、http的默认端口号是80 +4、默认的http是不安全的,是明文的 +5、后面新增加的https是安全的,是加密的 +6、websocket 简称ws是即时通信协议,其实也是基于http协议 + + +```js + +const { log } = require('console'); +//导入http模块 +const http = require('http'); +//创建app +let app = http.createServer((req,res)=>{ + res.end('hello,kangk') +}); + +//让服务器监听 +let poyt=8089 +app.listen(poyt); + +console.log('服务器跑起来咯'); + +``` \ No newline at end of file -- Gitee From d707f64170bcdc0194dfd12d4a3d6957a440aa32 Mon Sep 17 00:00:00 2001 From: shan <2434909991@qq.com> Date: Sun, 19 Feb 2023 13:41:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?http=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20230217-http\346\250\241\345\235\227.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" "b/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" index 1f806f9..ac570f6 100644 --- "a/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" +++ "b/\345\262\221\345\234\243\345\261\261/20230217-http\346\250\241\345\235\227.md" @@ -8,7 +8,7 @@ 6、websocket 简称ws是即时通信协议,其实也是基于http协议 -```js +``` const { log } = require('console'); //导入http模块 @@ -19,7 +19,7 @@ let app = http.createServer((req,res)=>{ }); //让服务器监听 -let poyt=8089 +let poyt=80 app.listen(poyt); console.log('服务器跑起来咯'); -- Gitee