一个网页请求,包含2次 http包交换

    • 浏览器向 http服务器发送请求 http包
    • http服务器向浏览器返回 http包
    1. const http = require('http');
    2. http.createServer((request, response) => {
    3. response.writeHead(200)
    4. response.end('ok')
    5. })
    6. .listen(3000)