473,795 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.mi rrored.com:80"
strrmethod = request.serverv ariables("REQUE ST_METHOD")
if left(request.qu erystring,3) = "404" then
'we have page request other than this one, parse script request and
path out of querystring

intlen = 11 + len(request.ser vervariables("S ERVER_NAME")) + 1 + _
len(request.ser vervariables("S ERVER_PORT"))
strrequestfile = right(request.q uerystring,len( request.queryst ring)-
intlen)
end if
strrequest = strmirrorurl & strrequestfile

call Proxy(strreques t,strRmethod)

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

lngResolve =5000
lngConnect = 5000
lngReceive = 5000
lngSend = 5000
set objHTTP = server.CreateOb ject("Msxml2.se rverXMLHTTP")
objHttp.setTime outs lngResolve, lngConnect, lngSend, lngReceive

objHTTP.open strRmethod, strRequest, false
objHTTP.send

Response.Conten tType = objhttp.getResp onseHeader("Con tent-Type")
Response.Binary Write objhttp.respons ebody
set objhttp = nothing
end Sub
%>
'END SCRIPT
Jul 19 '05 #1
2 24691
A bit like ISA Server?
http://www.microsoft.com/isaserver/default.asp

Cheers
Ken
--
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~
"aspguru" <as*****@email. com> wrote in message
news:21******** *************** ***@posting.goo gle.com...
: 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.mi rrored.com:80"
: strrmethod = request.serverv ariables("REQUE ST_METHOD")
: if left(request.qu erystring,3) = "404" then
: 'we have page request other than this one, parse script request and
: path out of querystring
:
: intlen = 11 + len(request.ser vervariables("S ERVER_NAME")) + 1 + _
: len(request.ser vervariables("S ERVER_PORT"))
: strrequestfile = right(request.q uerystring,len( request.queryst ring)-
: intlen)
: end if
: strrequest = strmirrorurl & strrequestfile
:
: call Proxy(strreques t,strRmethod)
:
: sub Proxy(strReques t,strRmethod)
: dim ObjHTTP
: dim lngResolve
: dim lngConnect
: dim lngReceive
: dim lngSend
:
: lngResolve =5000
: lngConnect = 5000
: lngReceive = 5000
: lngSend = 5000
: set objHTTP = server.CreateOb ject("Msxml2.se rverXMLHTTP")
:
:
: objHttp.setTime outs lngResolve, lngConnect, lngSend, lngReceive
:
: objHTTP.open strRmethod, strRequest, false
: objHTTP.send
:
: Response.Conten tType = objhttp.getResp onseHeader("Con tent-Type")
: Response.Binary Write objhttp.respons ebody
: set objhttp = nothing
: end Sub
: %>
: 'END SCRIPT
Jul 19 '05 #2
"Ken Schaefer" <ke*******@THIS adOpenStatic.co m> wrote in message news:<#y******* ******@TK2MSFTN GP11.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
4348
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 HTML version is much more readable than the ReST version. See: http://www.python.org/peps/pep-0322.html
8
11792
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? Thanks for any help you can throw my way, Chris Gray "Okey dokey.. free my mind. Right, no problem, free my mind, free my mind,
16
60619
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 http://xhaus.com/alan/python/proxies.html, but while many claim to support https, if you actually point your browser at the proxies, they work fine for http, but not for https pages. TIA
1
12664
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 accessed. The site in the code is valid for ease of testing. I also am including the LWP debug info for each attempt. Can anyone explain this behavior and what can I do to correct it? Thanks in advance
3
6636
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
2304
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 and then proxying it with mod_proxy?
3
1750
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 sense to keep it outside the network, and only use the reverse proxy when making dynamic data calls, but how could that actually work in practise? Is it possible to mix it up like this?
5
2870
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 B. If my proxy gets error404/500 from Server B then it will redirect the page to other site, using PHP. For this reason, I set ErrorDocument 404/500 on httpd.conf file in reverse proxy server to catch error from Server B. But ErrorDocument is not ...
0
2736
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 10.0.0.200).I am getting some 100 requests from a client (in 10.0.0.185). How to configure the directives in mod_proxy, so that 10.0.0.200 can handle 50 requests and 10.0.0.225 can handle 50 requests.I have added LoadModule mod_proxy...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.