iweblogv2ex
V2EX  ›  Node.js

nodejs http request 返回内容

  •  
  •   iweblogv2ex · Sep 3, 2013 · 8421 views
    This topic created in 4642 days ago, the information mentioned may be changed or developed.
    var http = require('http');

    http.createServer(function(request, response) {
    var proxyRequest = http.request({
    host: request.headers['host'],
    port: 80,
    path: request.url,
    method: request.method,
    headers: request.headers
    }, function(proxyResponse) {
    console.log(proxyResponse.headers);
    response.writeHead(proxyResponse.statusCode, proxyResponse.headers);
    proxyResponse.pipe(response);
    });
    request.pipe(proxyRequest);
    }).listen(8080);

    请问怎么修改proxyResponse的html?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3616 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:39 · PVG 12:39 · LAX 21:39 · JFK 00:39
    ♥ Do have faith in what you're doing.