Saturday 10 July 2021

Reverse proxy using javascript

I am trying to create a reverse-proxy webapplication using flask. I don't really know it is called reverse-proxy exactly but my webapp gets url from ../proxy/<url> and using requests and bs4 in python scrape the website and do some change in <a href="</test>"> to <a href="../proxy/<domain>/test"> and same for <form> and for other links also in the website for making sure that next request to the page is through proxy but some page that uses javascript to load data doesn't goes through ../proxy, they just send request like a normal website.

Now here is my question,

Is there any way to create an environment like things to make every link go through proxy or what could be the other best way to do such reverse-proxy things in flask? How to make sure that each and every time that website connect to network then connect through the proxy?

Edit: Idea:

  1. Making browser log like things using javascipt, but while any link want to connect to internet then manuplate it into /poryx/<url>.
  2. CROS: I don't know what to say but make CORS or using CORS to block request to other domain.


from Reverse proxy using javascript

No comments:

Post a Comment