nodejs:http内容未完全传输

时间:2018-10-31 14:27:45

标签: javascript node.js express

express = require('express');

app.get("/proxy*", function (request, response) {

    options = {
        host: rmHost,
        port: 4000,
        path: request.originalUrl,
        method: 'GET',
        headers: {
            secure: false
        }
    };
    console.log(request.originalUrl);
    http.get(options, (resp) => {
        let data = '';
        resp.on('data', function(chunk)    {
            data += chunk;
        });

        resp.on('end', () => {
            response.write(data);
            response.end()
        });
    }).on("error", (err) => {
        response.write("Error: " + err.message);
    });
});

内容未完全转移到客户端,并出现以下错误:

  

未捕获的SyntaxError:意外令牌<   jquery-ui-1.9.1.custom.min.js:1

未捕获到的SyntaxError:意外令牌>

未捕获到的SyntaxError:意外令牌<< / p>

  

test.dt.plugins.js:18

未捕获的ReferenceError:未定义jQuery

at test.dt.plugins.js:18 RUNNING:38 

未捕获的ReferenceError:未定义$

at RUNNING:38 RUNNING:53 

0 个答案:

没有答案