views:

67

answers:

1

Hi everyone!

I want to develop an asp.net website which gets an address as an input and fetches all contents of the website and changes links and js path and css paths which causes the content to be displayed correctly, and then Response.Write all of this content to my website.

My question is that what's problems with this work, I mean about security. Isn't it dangerous when I write direct content to my page?

meanwhile, I want to change for example any css link like:

http://www.targetdomain.com/style.css

to

http://www.mydomain.com/GetContent.aspx?url=http://www.targetdomain.com/style.css

Thank you.

+4  A: 

What you want is called a 'proxy' server.

Unfortunately, there's no easy way to get an entire webpage - and all associated content - and feed it back to the requester as a single blob. You'd have to feed each of the individual pieces back to the requester, modifying links inside the code as necessary to keep them pointing at the right stuff. This is not an easy task.

Given your location, I'm going to guess that you want this set up quickly. You might be better off downloading any one of the many, many proxy software packages out there and installing it, rather than trying to write it yourself.

Good luck.

Aric TenEyck
thank you, and you are too clever because of guessing that, but I just wanted to know the problems of writing content of an unknown web site to my web site. ;)
Hossein Margani