Welcome Guest Search | Active Topics | Members | Log In | Register

HTML proxying in ASP.NET? Options · View
Jeff Dege
Posted: Tuesday, October 02, 2007 3:22:53 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 02/10/2007 15:22:53
Date: Tue, 02 Oct 2007 15:22:53 -0000

We have an app that is written in C#/ASP.NET 2.0, and hosted on IIS.

Or rather, it's mostly written in ASP.NET, but parts of it are client-
side javascript, pulling data from an Apache webserver in an ajax-like
fashion.

There is no chance of converting the Apache pages to run on IIS, or the
IIS pages to run on Apache, so we're inherently stuck with cross-domain
XMLHttpRequest() calls.

To this point, we've been running both IIS and Apache on different ports
on the same servers, and have had no problem. But we are concerned that
we will begin to see browsers that will reject calls to different ports.
And beyond that, we'd really like to try hosting Apache on a separate
box, better tuned for the sort of load that's being put on it.

That means we need a Web Proxy. And one that will run on IIS, and that
we can build, and maintain, with our current tool set (ASP.NET).

Problem is I've not been able to find one. There are plenty of simple
web proxies out there for Apache, and written in PHP, or CGI. But I've
not found an example of a simple web proxy for IIS written in ASP.NET.

I know people have had to have done this. But I've not been able to find
anything on the web. Is there some simple solution I've missed?

--
The government consists of a gang of men exactly like you and me. They
have, taking one with another, no special talent for the business of
government; they have only a talent for getting and holding office. Their
principal device to that end is to search out groups who pant and pine
for something they can't get and to promise to give it to them. Nine times
out of ten that promise is worth nothing. The tenth time is made good by
looting A to satisfy B. In other words, government is a broker in pillage,
and every election is sort of an advance auction sale of stolen goods.
- H. L. Mencken
Mike Placentra II
Posted: Wednesday, October 03, 2007 12:18:59 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 03/10/2007 00:18:59
Date: Wed, 03 Oct 2007 00:18:59 -0000

Have you considered communicating server-to-server with ASP.net web
services and (for example) PHP with NuSOAP? You might be able to skip
the JavaScript altogether.

-Mike Placentra II


On Oct 2, 11:22 am, Jeff Dege <jd...@jdege.visi.com> wrote:
> We have an app that is written in C#/ASP.NET 2.0, and hosted on IIS.
>
> Or rather, it's mostly written in ASP.NET, but parts of it are client-
> side javascript, pulling data from an Apache webserver in an ajax-like
> fashion.
>
> There is no chance of converting the Apache pages to run on IIS, or the
> IIS pages to run on Apache, so we're inherently stuck with cross-domain
> XMLHttpRequest() calls.
>
> To this point, we've been running both IIS and Apache on different ports
> on the same servers, and have had no problem. But we are concerned that
> we will begin to see browsers that will reject calls to different ports.
> And beyond that, we'd really like to try hosting Apache on a separate
> box, better tuned for the sort of load that's being put on it.
>
> That means we need a Web Proxy. And one that will run on IIS, and that
> we can build, and maintain, with our current tool set (ASP.NET).
>
> Problem is I've not been able to find one. There are plenty of simple
> web proxies out there for Apache, and written in PHP, or CGI. But I've
> not found an example of a simple web proxy for IIS written in ASP.NET.
>
> I know people have had to have done this. But I've not been able to find
> anything on the web. Is there some simple solution I've missed?
>
> --
> The government consists of a gang of men exactly like you and me. They
> have, taking one with another, no special talent for the business of
> government; they have only a talent for getting and holding office. Their
> principal device to that end is to search out groups who pant and pine
> for something they can't get and to promise to give it to them. Nine times
> out of ten that promise is worth nothing. The tenth time is made good by
> looting A to satisfy B. In other words, government is a broker in pillage,
> and every election is sort of an advance auction sale of stolen goods.
> - H. L. Mencken

jdege@korterra.com
Posted: Wednesday, October 03, 2007 6:02:44 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 03/10/2007 18:02:44
Date: Wed, 03 Oct 2007 18:02:44 -0000

On Oct 2, 7:18 pm, Mike Placentra II
<nothingsoriginalontheinter...@gmail.com> wrote:
> Have you considered communicating server-to-server with ASP.net web
> services and (for example) PHP with NuSOAP? You might be able to skip
> the JavaScript altogether.

I'm sorry, but that seems non-responsive.

We have javascript on a browser that needs to access data on a
webserver other than the one that served the page that contains the
javascript. I don't see how any server-to-server solution could be
relevant.

The browser gets a page from:

http://server/webapp/page.aspx

The javascript on that page gets images from:

http://server:8080/imageapp.php?x=1&y=2

The problem is that some browsers consider http://server and http://server:8080
to be distinct domains - and over time more and more browsers will do
so.

What we need is a URL like:

http://server/proxy.aspx&uri=http://server:8080/imageapp.php?x=1&y=2

So the request goes to the same domain as the original page, but where
the proxy page we're requesting pulls the page from the URI that is
passed to it as an argument.

There are packages to create proxies like this on Apache readily
available on the net. But we need one that will run on IIS.
Preferably one written in C#/ASP.NET, so we can build it and maintain
it with our current toolset.

This seems like a very simple problem, and I know people have had to
address it - but I've not been able to find any examples.


Jeff Dege
Posted: Friday, October 05, 2007 7:40:31 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 05/10/2007 19:40:31
Date: Fri, 05 Oct 2007 19:40:31 -0000

On Tue, 02 Oct 2007 15:22:53 +0000, Jeff Dege wrote:

> Problem is I've not been able to find one. There are plenty of simple
> web proxies out there for Apache, and written in PHP, or CGI. But I've
> not found an example of a simple web proxy for IIS written in ASP.NET.
>
> I know people have had to have done this. But I've not been able to
> find anything on the web. Is there some simple solution I've missed?

I found a discussion of proxying in IIS at:

http://blogs.msdn.com/david.wang/archive/2005/08/01/
HOWTO_Common_URL_Red
irection_Techniques_for_IIS_Summary.aspx

It suggested a commercial package called ISAPI_Rewrite. I've tested it a
bit, and it seems to be working.

--
Want to understand why politicians do what they do? Simple: when you're
a big, gray, greasy rat, walking around on two hind legs, you have a
lot to gain by turning the world into a garbage heap.
-- Memoirs of Lucille G. Kropotkin
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 4.928 seconds.