Skip to content

Simple HTTP proxying fails #92

@t-beckmann

Description

@t-beckmann

The script below requires express.js and request.js simply installed using npm. When running it on node.js and browsing to http://localhost:8090/request you'll get the landing page of google, as expected. However, when running in Trireme, the response data is truncated half-way of data. Trouble is, the reading side of the client socket is closed although not all data was read...

var request = require('request');
var express = require('express');
var app = express();

app.get('/request', function(req, res) {
    request('http://www.google.de', function(error, response, body) {
       if(error) {
           console.log(error);
           res.send(response.statusCode, error);
           throw error;
       }
       console.log(body);
       res.send(response.statusCode, body);
    });
});
app.listen(8090);

console.log(process.versions);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions