|
-
Aug 9th, 2011, 02:55 AM
#1
Thread Starter
New Member
proxypage: filetype / mimetype
Hello!
This is my first post here. Actually, im not really a programmer, but im trying to figure out some stuff. Hopefully with your help.
Im in need of a kind of "proxypage", that will rewrite some lines of html.
While doing that, i also need to process all included files like .js and images.
I want to read an HTML file. All links will be rewritten, so a src="/images/blank.gif" will be something like src="proxypage.aspx?proxiepath=/images/blank.gif"
The proxypage should stream this file, and display it as normal. But how? all I get is a bunch of charakters on the screen, so i assume it has something to do with a mimetype. How can I get this mimetype, and how can I set it 
The code that im using to stream is the following:
(beware, im not a developer! )
proxiedURL would be the name of the file, so : http://xx.xx.xx.xx/images/blank.gif, http://xx.xx.xx.xx/js/custom.js or the html file i want to rewrite.
Code:
webRequest = webRequest.Create(New Uri(proxiedURL))
webresponse = webRequest.GetResponse()
ProxyStream = New StreamReader(webresponse.GetResponseStream())
While (Not ProxyStream.EndOfStream)
regel = ProxyStream.ReadLine
' DO SOME STUFF WITH REGEXP TO REWRITE HTML LINES
Response.Write(regel)
End While
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|