request proxy and relative links

29 views Asked by At

In my expressJS setup, I am having it use the Request module to load an external url and pipe it to the response.

Example:

app.all('/otherApp', function (req, res) {

    request.get({
        url:'http://myotherapp.mysite.com'
    }).pipe(res);

});

This will load the external site as expected, but none of the actual content. I believe what happens is that all of the calls made from that page will now be processed by my own app, rather than theirs. So for instance if it tries to load an image, it will look for that image on my own application and of course not find it.

I am not able to find any documentation on the request package that would explain how to overcome this limitation.

0

There are 0 answers