I am trying to create a reverse-proxy web application using Flask. I don't really know weather to call it reverse-proxy or not but my idea is that the web app gets a URL from ../proxy/<URL>
, goes to URL
like it got example.com
from ../proxy/example.com
, and now takes the HTML (Page source code) from that website and using Flask sends that HTML as response to ../proxy/www.example.com
.
Now here is the security question
While doing all these things, websites don't load their data just from a single request; some load data using JavaScript, Ajax and using other stuff client-side. If a website is loading data client side, then they may go directly to the website, that means they don't go through proxy. Is that a security issue or not, because on requesting the website directly the user may leak their IP address, the website may save their cookies on user's browser and other things also. Is there any idea to solve this issue if it is issue? And if it is not issue, then why not, because connecting directly to website mean user can leak their IP address to the website and while connecting directly to website, the website can save their cookies in their website. They save cookies in our website or in their website because it is connected from /proxy/<URL>
. No, I don't mean through proxy but I mean while connecting directly to website they are under my website like they are in /proxy/example.com
and then it is connected into their website.