You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Panos Konstantinidis <gi...@yahoo.com> on 2006/06/13 14:22:38 UTC

Outgoing requests to match a specific IP

Hello, we have a computer that is registered to two IP addresses. I have
installed Tomcat on this computer and I have deployed a web application. This
web application does some XML processing and then sends a request to another
server. This other server is configured to only accept requests from a specific
IP address. Unfortunatelly this IP address is not the one Tocmat is bind to
when an outgoing request leaves. My question is how I can make Tomcat to tie a
specific request to otehr IP address, the one that is allowed to connect to the
second server. All information I have found so far is only for incoming
requests (listening) not for outgoing.

Any help is appreciated

Regards

Panos

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Outgoing requests to match a specific IP

Posted by Reinhard Moosauer <rm...@moosauer.de>.
Hi,

the outbound address is determined from the routing on OS level.
Fix your routes and the outgoing address is ok also.

If this is not possible, you can resort to NAT (network address translation). 
This solution is used very widely.

regards,
R.

Am Dienstag, 13. Juni 2006 14:56 schrieb Panos Konstantinidis:
> Hello Tim, thank you for your prompt reply.
>
> Your solution would work, however we are using a third party API that does
> this call to the specific server (actually what it is doing is to issue an
> HTTP request to another Servlet), and I do not have access to the source
> code, nor I would like to decompile the API and modify the source code.
>
> Any other alternatives?
>
> Regards
>
> Panos
>
> --- Tim Funk <fu...@joedog.org> wrote:
> > Its not a tomcat setting, it java socket programming.
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html#Socket(java.ne
>t.InetAddress,%20int,%20java.net.InetAddress,%20int)
>
> > Whatever library is making the outbound call should have an option to
> > choose the local ip address the connection is bound to. If it doesn't,
> > then you are SOL.
> >
> > -Tim
> >
> > Panos Konstantinidis wrote:
> > > Hello, we have a computer that is registered to two IP addresses. I
> > > have installed Tomcat on this computer and I have deployed a web
> > > application.
> >
> > This
> >
> > > web application does some XML processing and then sends a request to
> >
> > another
> >
> > > server. This other server is configured to only accept requests from a
> >
> > specific
> >
> > > IP address. Unfortunatelly this IP address is not the one Tocmat is
> > > bind to when an outgoing request leaves. My question is how I can make
> > > Tomcat to
> >
> > tie a
> >
> > > specific request to otehr IP address, the one that is allowed to
> > > connect to
> >
> > the
> >
> > > second server. All information I have found so far is only for incoming
> > > requests (listening) not for outgoing.
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Outgoing requests to match a specific IP

Posted by Panos Konstantinidis <gi...@yahoo.com>.
Hello Tim, thank you for your prompt reply. 

Your solution would work, however we are using a third party API that does this
call to the specific server (actually what it is doing is to issue an HTTP
request to another Servlet), and I do not have access to the source code, nor I
would like to decompile the API and modify the source code.

Any other alternatives?

Regards

Panos

--- Tim Funk <fu...@joedog.org> wrote:

> Its not a tomcat setting, it java socket programming.
> 
>
http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html#Socket(java.net.InetAddress,%20int,%20java.net.InetAddress,%20int)
> 
> Whatever library is making the outbound call should have an option to choose 
> the local ip address the connection is bound to. If it doesn't, then you are
> SOL.
> 
> -Tim
> 
> Panos Konstantinidis wrote:
> > Hello, we have a computer that is registered to two IP addresses. I have
> > installed Tomcat on this computer and I have deployed a web application.
> This
> > web application does some XML processing and then sends a request to
> another
> > server. This other server is configured to only accept requests from a
> specific
> > IP address. Unfortunatelly this IP address is not the one Tocmat is bind to
> > when an outgoing request leaves. My question is how I can make Tomcat to
> tie a
> > specific request to otehr IP address, the one that is allowed to connect to
> the
> > second server. All information I have found so far is only for incoming
> > requests (listening) not for outgoing.
> > 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Outgoing requests to match a specific IP

Posted by Tim Funk <fu...@joedog.org>.
Its not a tomcat setting, it java socket programming.

http://java.sun.com/j2se/1.4.2/docs/api/java/net/Socket.html#Socket(java.net.InetAddress,%20int,%20java.net.InetAddress,%20int)

Whatever library is making the outbound call should have an option to choose 
the local ip address the connection is bound to. If it doesn't, then you are SOL.

-Tim

Panos Konstantinidis wrote:
> Hello, we have a computer that is registered to two IP addresses. I have
> installed Tomcat on this computer and I have deployed a web application. This
> web application does some XML processing and then sends a request to another
> server. This other server is configured to only accept requests from a specific
> IP address. Unfortunatelly this IP address is not the one Tocmat is bind to
> when an outgoing request leaves. My question is how I can make Tomcat to tie a
> specific request to otehr IP address, the one that is allowed to connect to the
> second server. All information I have found so far is only for incoming
> requests (listening) not for outgoing.
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org