V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iweblogv2ex
V2EX  ›  Node.js

nodejs http request 返回内容

  •  
  •   iweblogv2ex · 2013-09-03 03:56:46 +08:00 · 7387 次点击
    这是一个创建于 3888 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4473 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:03 · PVG 18:03 · LAX 03:03 · JFK 06:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.