473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

IIS Reverse Proxy scipt (like mod_proxy)

I have been hunting around recently for reverse proxy solutions to
work with IIS. An example use for this would be to put outlook web
access on your multi host IIS box on port 80 or an application like
sitecope on IIS's port 80. There are many 3rd party solutions below
some including ISAPI filters.

http://www.at32.com/doc/rproxy.htm
http://www.isapirewrite.com/
http://www.octagate.com/

I've managed to sort of half fudge this with a single ASP script. If
you name it default.asp and point your default 404 error message to a
URL of "/default.asp" it will kick in for every request on the site.
The upshot of all this is it's like a virtual directory but instead of
pointing to another local folder, UNC path or URL redirect it feeds
another site by proxy.

I have tested this with Outlook Web Access and seems to work (just
need to pass username and password arguments on the objHTTP.send line)

The script admittedly is far from perfect for example not handling
form posts , login credential requests so I would welcome comments /
enhancements.

'BEGIN SCRIPT
<%
option explicit
'on error resume next

dim strmirrorURL
dim strRequest
dim strrequestfile
dim intlen
dim strRmethod

strmirrorURL = "http://server.to.be.mirrored.com:80"
strrmethod = request.servervariables("REQUEST_METHOD")
if left(request.querystring,3) = "404" then
'we have page request other than this one, parse script request and
path out of querystring

intlen = 11 + len(request.servervariables("SERVER_NAME")) + 1 + _
len(request.servervariables("SERVER_PORT"))
strrequestfile = right(request.querystring,len(request.querystring)-
intlen)
end if
strrequest = strmirrorurl & strrequestfile

call Proxy(strrequest,strRmethod)

sub Proxy(strRequest,strRmethod)
dim ObjHTTP
dim lngResolve
dim lngConnect
dim lngReceive
dim lngSend

lngResolve =5000
lngConnect = 5000
lngReceive = 5000
lngSend = 5000
set objHTTP = server.CreateObject("Msxml2.serverXMLHTTP")
objHttp.setTimeouts lngResolve, lngConnect, lngSend, lngReceive

objHTTP.open strRmethod, strRequest, false
objHTTP.send

Response.ContentType = objhttp.getResponseHeader("Content-Type")
Response.BinaryWrite objhttp.responsebody
set objhttp = nothing
end Sub
%>
'END SCRIPT
Jul 19 '05 #1
2 24655
A bit like ISA Server?
http://www.microsoft.com/isaserver/default.asp

Cheers
Ken
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"aspguru" <as*****@email.com> wrote in message
news:21**************************@posting.google.c om...
: I have been hunting around recently for reverse proxy solutions to
: work with IIS. An example use for this would be to put outlook web
: access on your multi host IIS box on port 80 or an application like
: sitecope on IIS's port 80. There are many 3rd party solutions below
: some including ISAPI filters.
:
: http://www.at32.com/doc/rproxy.htm
: http://www.isapirewrite.com/
: http://www.octagate.com/
:
: I've managed to sort of half fudge this with a single ASP script. If
: you name it default.asp and point your default 404 error message to a
: URL of "/default.asp" it will kick in for every request on the site.
: The upshot of all this is it's like a virtual directory but instead of
: pointing to another local folder, UNC path or URL redirect it feeds
: another site by proxy.
:
: I have tested this with Outlook Web Access and seems to work (just
: need to pass username and password arguments on the objHTTP.send line)
:
: The script admittedly is far from perfect for example not handling
: form posts , login credential requests so I would welcome comments /
: enhancements.
:
: 'BEGIN SCRIPT
: <%
: option explicit
: 'on error resume next
:
: dim strmirrorURL
: dim strRequest
: dim strrequestfile
: dim intlen
: dim strRmethod
:
: strmirrorURL = "http://server.to.be.mirrored.com:80"
: strrmethod = request.servervariables("REQUEST_METHOD")
: if left(request.querystring,3) = "404" then
: 'we have page request other than this one, parse script request and
: path out of querystring
:
: intlen = 11 + len(request.servervariables("SERVER_NAME")) + 1 + _
: len(request.servervariables("SERVER_PORT"))
: strrequestfile = right(request.querystring,len(request.querystring)-
: intlen)
: end if
: strrequest = strmirrorurl & strrequestfile
:
: call Proxy(strrequest,strRmethod)
:
: sub Proxy(strRequest,strRmethod)
: dim ObjHTTP
: dim lngResolve
: dim lngConnect
: dim lngReceive
: dim lngSend
:
: lngResolve =5000
: lngConnect = 5000
: lngReceive = 5000
: lngSend = 5000
: set objHTTP = server.CreateObject("Msxml2.serverXMLHTTP")
:
:
: objHttp.setTimeouts lngResolve, lngConnect, lngSend, lngReceive
:
: objHTTP.open strRmethod, strRequest, false
: objHTTP.send
:
: Response.ContentType = objhttp.getResponseHeader("Content-Type")
: Response.BinaryWrite objhttp.responsebody
: set objhttp = nothing
: end Sub
: %>
: 'END SCRIPT
Jul 19 '05 #2
"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message news:<#y*************@TK2MSFTNGP11.phx.gbl>...
A bit like ISA Server?
http://www.microsoft.com/isaserver/default.asp

Cheers
Ken


Yes I understand ISA performs a reverse proxy function also.
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

59
by: Raymond Hettinger | last post by:
Please comment on the new PEP for reverse iteration methods. Basically, the idea looks like this: for i in xrange(10).iter_backwards(): # 9,8,7,6,5,4,3,2,1,0 <do something with i> The...
8
by: Chris Gray | last post by:
Is there such a beast? In particular, I'm looking for a production-quality proxy server fully compliant with HTTP/1.1 written in Python. If there isn't, is there anything that comes close? ...
16
by: Paul Sweeney | last post by:
Does anyone know of a working (python) https proxy which allows viewing of unencrypted data being sent from my browser to an https site? I've worked my way through most on the list at...
1
by: Woogie | last post by:
When running the sample code below without a proxy the GET returns the expected data. When run with the $proxy uncommented the GET returns the content of the login page for the site being...
3
by: A.M | last post by:
Hi, We are developing ADP.NET applications and one of our requirements is implementing a Reverse Proxy on IIS. I have couple of questions about Reverse Proxy:
1
by: =?iso-8859-1?Q?David_S=E1nchez_Mart=EDn?= | last post by:
Hi! I've seen the message below in this python list, that seems to be unanswered. I'm trying to do the pretty same thing. There's a way to preprocess the request with a mod_python handler...
3
by: Jane Parker | last post by:
I read with interest the recent posting about Reverse Proxies and wondered if it is possible to mix static and dynamic content. If you have a lot of static content on your site it would make...
5
by: kokababu | last post by:
Hi, I have setup a reverse proxy server which will route the request to Server B. Proxy server is working well with Server B. I would like to catch HTTP status error like 404/500 from server...
0
by: ShrutiAdiga | last post by:
Hi, I am trying to use mod_proxy in Apache to perform load balancing.I am using an Apache server with mod_proxy(in 10.0.0.225), I want to distribute the load between 2 servers(say 10.0.0.225 and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.