Problems with Request module in NodeJS regarding ports

We are setting up an expressJS server in NodeJS. So as to overcome the cross-origin error on the client side, we have developed a proxy on the server side, using the "request" module from Mikeal (https://github.com/mikeal/request). The idea is that if you access the route "/proxy" by GET then we will redirect the call to the url specified in the "url" parameter. For example, if I try to access

    "http://127.0.0.1/proxy?url=http://www.google.com", 

then it will have to respond with the content of www.google.com.

Here is an excerpt of the code:

app.get('/proxy', function(req,res) {
    var newurl = req.param('url');
    request(newurl).pipe(res);
};

The thing is, if we do not specify a port on the URL (that is, we consider the standard 80 port), everything works as a charm. But, if we want to specify a port, for example,

    "http://127.0.0.1/proxy?url=http://192.168.9.18:3000", 

then I receive a 502 error "Bad Gateway". When we tried consolelogging the request object, everything seems to be fine, the url is correctly parsed and the port is identified. Any idea if this is a problem in the request module? Thanks in advance.