-1

i have a computer1 with ip 192.168.10.1 subnet 255.255.255.0 without internet access
another computer2 with ip 192.168.1.1 subnet 255.255.255.0
a router1 with ip 192.168.1.200 and 192.168.10.200
a router2 with ip 192.168.1.254 connected on internet
what i want to do is from wan reach computer1 and access the url 192.168.10.1/xyz/urlxyz.html the problem is that i want a free access only for the urls with /xyz/ so i was thinking to use some kind of redirect from computer2 to computer1 like that

app.get('/xyz/',function(req,res){
      request.get("http://192.168.10.1"+req.originalUrl).on('error', function(err) {
    console.error(err)
  }).pipe(res);
}); //request is a deprecated library

this partially works but doesn't send all the headers and other data and the site output errors, is possible to do something like that without use a proxy or vpn or something to add on the computer in the wan ? i don't want give a full access to the subnet 192.168.10.x or the other services on the computer1
note i already use that code for access another url and that works since i access a printer and just send the data i need to print

Trigun
  • 73
  • 9

1 Answers1

0

you can use Axios to pass header and body data for your requirements. And also you can add a limit in the header and response.