一、网络基础概念
1、ip也称为IP地址,本身是一个数字标识,例如192.168.1.3, 用来标识网络设备,实现设备间通信
2、ip的分类
局域网 + 公域网
本地回环IP地址: 127.0.0.1

3、端口
定义: 应用程序的数字标识,一台现代极端集有65536个端口(0~65535),实现了不同主机应用之间的通信
一个应用程序可以使用一个或多个端口
二、http模块
1、创建http服务
// 导入http 模块
const http = require('http');
// 创建一个HTTP服务器
const server = http.createServer((req, res) => {
// 设置响应头
res.writeHead(200, { 'Content-Type': 'text/plain' });
// 发送响应数据
res.end('Hello, Node.js HTTP Server!\n');
});
// 服务器监听端口
const PORT = 3000;
server.listen(PORT, () => {
console.log(`Server is running at http://localhost:${PORT}`);
});
2、http服务的注意事项

3、获取HTTP请求报文
