You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Cittadini <Da...@blackmarble.com> on 2000/04/05 21:26:57 UTC

Access to the Socket

In version 3.0 you could gain access to the underlying Socket of a request
by making a call through ServerRequest.  However, this is deprecated in
version 3.1.  Therefore, how can I get direct access to the socket of a
request?  The reason for the question is that I want to implement a security
interceptor that will update the socket depending on the socket type.

RE: Access to the Socket

Posted by David Cittadini <Da...@blackmarble.com>.
In answer to question (a), it does already…..  (I should look harder next
time)

-----Original Message-----
From: David Cittadini [mailto:David.Cittadini@blackmarble.com]
Sent: Thursday, 6 April 2000 17:17
To: tomcat-user@jakarta.apache.org
Subject: RE: Access to the Socket

I have created my own security implementation that, amongst other things, is
centred on creating an HttpServer and then registering my own Security
Provider and Security Interceptor.  As part of the authentication process,
the interceptor calls isSecure() on the Request that in turn calls
isSecure() on the Security Provider.  The Security Provider then checks the
Request type (via getRealRequest()) and if it was a ServerRequest I called
getSocket() on it.  This then enabled me perform some specialist processing
in situations where I had my own specialised Socket.

However, in version 3.1 you can no longer get the Socket from the request
(via ServerRequest).  As a result, I am probably going to have to write my
own Connector and enable it to publish the Socket.  Then, inside my Security
Provider, I will have to call the Context Manager, run through the
registered connectors and match the calling port of the Request with the
ports of the connectors in the Context Manager.  Then, once I find a
matching port, check the Connector and get the Socket and perform my
Socket-related processing.  This is certainly a bit more tortured than
version 3.0.  Therefore, questions are:

a)                   HttpRequestAdapter has a setSocket() method, why not
also provide a getSocket() method.
b)                   Is the new version trying to hide the Socket as much as
possible so that the only way I can perform Socket-related processing is to
write my own specialized Connectors?
c)                   Is using a Security Provider the preferred way to get
the provider or is a new approach being designed?

I look forward to your comments, David.

-----Original Message-----
From: Costin Manolache [mailto:costin@eng.sun.com]
Sent: Thursday, 6 April 2000 6:27
To: tomcat-user@jakarta.apache.org
Subject: Re: Access to the Socket

You can't get access to the socket unless you are using the standalone http
adapter.
Costin
David Cittadini wrote:
In version 3.0 you could gain access to the underlying Socket of a request
by making a call through ServerRequest.However, this is deprecated in
version 3.1.Therefore, how can I get direct access to the socket of a
request?The reason for the question is that I want to implement a security
interceptor that will update the socket depending on the socket type.

RE: Access to the Socket

Posted by David Cittadini <Da...@blackmarble.com>.
I have created my own security implementation that, amongst other things, is
centred on creating an HttpServer and then registering my own Security
Provider and Security Interceptor.  As part of the authentication process,
the interceptor calls isSecure() on the Request that in turn calls
isSecure() on the Security Provider.  The Security Provider then checks the
Request type (via getRealRequest()) and if it was a ServerRequest I called
getSocket() on it.  This then enabled me perform some specialist processing
in situations where I had my own specialised Socket.

However, in version 3.1 you can no longer get the Socket from the request
(via ServerRequest).  As a result, I am probably going to have to write my
own Connector and enable it to publish the Socket.  Then, inside my Security
Provider, I will have to call the Context Manager, run through the
registered connectors and match the calling port of the Request with the
ports of the connectors in the Context Manager.  Then, once I find a
matching port, check the Connector and get the Socket and perform my
Socket-related processing.  This is certainly a bit more tortured than
version 3.0.  Therefore, questions are:

a)                   HttpRequestAdapter has a setSocket() method, why not
also provide a getSocket() method.
b)                   Is the new version trying to hide the Socket as much as
possible so that the only way I can perform Socket-related processing is to
write my own specialized Connectors?
c)                   Is using a Security Provider the preferred way to get
the provider or is a new approach being designed?

I look forward to your comments, David.

-----Original Message-----
From: Costin Manolache [mailto:costin@eng.sun.com]
Sent: Thursday, 6 April 2000 6:27
To: tomcat-user@jakarta.apache.org
Subject: Re: Access to the Socket

You can't get access to the socket unless you are using the standalone http
adapter.
Costin
David Cittadini wrote:
In version 3.0 you could gain access to the underlying Socket of a request
by making a call through ServerRequest.However, this is deprecated in
version 3.1.Therefore, how can I get direct access to the socket of a
request?The reason for the question is that I want to implement a security
interceptor that will update the socket depending on the socket type.

Re: Access to the Socket

Posted by Costin Manolache <co...@eng.sun.com>.
You can't get access to the socket unless you are using the standalone
http adapter.

Costin

David Cittadini wrote:

> In version 3.0 you could gain access to the underlying Socket of a
> request by making a call through ServerRequest.However, this is
> deprecated in version 3.1.Therefore, how can I get direct access to
> the socket of a request?The reason for the question is that I want to
> implement a security interceptor that will update the socket depending
> on the socket type.
>