WebSphere Application Server - detecting a proxy servers host and port

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > February 2005 > detecting a proxy servers host and port





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author detecting a proxy servers host and port
alo30bb

2005-01-28, 2:47 am

Does WebSphere have a way of identify the proxy host and port

The problem that I am faced with is when I issue getServerName and
getServerPort api calls it returns the host and port of IHS and not the
proxy server.

I noticed in both Tomcat and WebLOGIC that a setting exists, but I am unable
to find a similar setting in WebSphere.


Proxy Server -> IHS -> WAS51


Ray McVay

2005-01-28, 5:55 pm

I believe Apache/IHS has a setting that effects the headers that are
available but it seems to me the correct response is the one you're
getting. After all, that web server could be fed by multiple proxy
servers in some environments, right? In the Tomcat/WebLogic cases are
they running through Apache plugins or are they serving HTTP directly?

alo30bb wrote:
> Does WebSphere have a way of identify the proxy host and port
>
> The problem that I am faced with is when I issue getServerName and
> getServerPort api calls it returns the host and port of IHS and not the
> proxy server.
>
> I noticed in both Tomcat and WebLOGIC that a setting exists, but I am unable
> to find a similar setting in WebSphere.
>
>
> Proxy Server -> IHS -> WAS51
>
>

Ben_

2005-01-28, 5:55 pm

Hello,

It should return the Host and Port settings as specified in the HTTP
request:
"
public java.lang.String getServerName()
Returns the host name of the server that received the request. For HTTP
servlets, same as the value of the CGI variable SERVER_NAME.
Returns:
a String containing the name of the server to which the request was sent
http://java.sun.com/j2ee/sdk_1.3/te...ervletRequest.h
tml
"

If you refer to proxy as a forward proxy, I don't think you can't detect it,
unless it added a HTTP proxy directive. And then you need to lookup the
Headers.

If you refer to a reverse proxy, it can be that it rewrote the HTTP request
to set the host name instead of the public web site name.

What for a proxy are you referring to ?


alo30bb

2005-01-29, 5:55 pm

I am referring to a reverse proxy.
The proxy in this case IBM's WebSEAL; proxy's too a number of different
WebSphere's sometimes via the IHS plug-in.
In some respects the proxy is acting like a web server with a plug-in.
However I always get the servername and port of either IHS or WebSphere,
which causes me problems, when building url's.
Tomcat's how-to proxy is very clear on the problem and a solution.
I just haven't found the same type of solution in WAS.



"Ben_" <reply@newsgroup.com> wrote in message
news:ctds3c$450m$1@news.boulder.ibm.com...
> Hello,
>
> It should return the Host and Port settings as specified in the HTTP
> request:
> "
> public java.lang.String getServerName()
> Returns the host name of the server that received the request. For HTTP
> servlets, same as the value of the CGI variable SERVER_NAME.
> Returns:
> a String containing the name of the server to which the request was sent
> http://java.sun.com/j2ee/sdk_1.3/te...ervletRequest.h
> tml
> "
>
> If you refer to proxy as a forward proxy, I don't think you can't detect
> it,
> unless it added a HTTP proxy directive. And then you need to lookup the
> Headers.
>
> If you refer to a reverse proxy, it can be that it rewrote the HTTP
> request
> to set the host name instead of the public web site name.
>
> What for a proxy are you referring to ?
>
>



Ben_

2005-01-30, 5:52 pm

Still not clear what the problem is, except that WebSeal would rewrite the
HTTP traffic and set the Host header to the physical hostname. Maybe with
Tomcat solution described, we could know what the problem is...

Can you point to an article on the web ?


alo30bb

2005-01-31, 7:52 am

http://jakarta.apache.org/tomcat/to...roxy-howto.html

"Ben_" <reply@newsgroup.com> wrote in message
news:ctj660$6g6g$1@news.boulder.ibm.com...
> Still not clear what the problem is, except that WebSeal would rewrite the
> HTTP traffic and set the Host header to the physical hostname. Maybe with
> Tomcat solution described, we could know what the problem is...
>
> Can you point to an article on the web ?
>
>



Ben_

2005-01-31, 5:56 pm

You're referring to <Connector proxyName> setting ? I don't know of such an
option in WebSphere.

As far as I can understand the issue, it looks like WebSeal is configured to
rewrite the HTTP request and set the host header to the host it forwards the
traffic to. Why not leave the Host header to its original value. I suppose
it's a matter of configuration (not a WebSeal specialist though) ?


alo30bb

2005-02-01, 6:13 pm

The problem is however, that when I construct a url, it is being constructed
with
websphere's host and port (http://somehost:9080) and not that of the proxy
(https://proxyhost.something.com).

"Ben_" <reply@newsgroup.com> wrote in message
news:ctlgqs$4iha$1@news.boulder.ibm.com...
> You're referring to <Connector proxyName> setting ? I don't know of such
> an
> option in WebSphere.
>
> As far as I can understand the issue, it looks like WebSeal is configured
> to
> rewrite the HTTP request and set the host header to the host it forwards
> the
> traffic to. Why not leave the Host header to its original value. I suppose
> it's a matter of configuration (not a WebSeal specialist though) ?
>
>



Ben_

2005-02-02, 2:57 am

This sounds logical to me, if WebSeal rewrite the HTTP traffic to set the
Host header to the hostname it forwards the traffic to.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com