On Fri, 26 Mar 2004 13:18:02 -0500, Michael Becke wrote:
> > As you have guessed by now, I agree that not the
> socket itself
> > but only the streams should be made available.
> 
> Yes, I think this is the big question.  Is having
> access to the I/O 
> streams enough or would someone need access to the
> actual Socket?  If 
> it's just the streams then I think we can probably do
> this now.  If we 
> need access to the socket then we need to rethink
> things a little.

Hi Guys,

My 2 cents on this is that it should be the Socket, not
i/o streams, although more work is involved and there
is a control issue at stake (who owns the Socket,
making it null in the HttpConnection to detach it etc.
etc).  By making the Socket available, you can almost
guarantee easy intergration with any Java app that uses
Sockets for some protocol, but needs to be augmented to
get through a web proxy.   

How about this approach: for the existing version, a
quick get/setSocket on HttpConnection with the advisory
to be careful and that things may change for 4.0.  In
4.0 more care can go into the design wrt control issues
etc. but I would still recommend some way to get at the
Socket in 4.0.   

Augmenting the Protocol class for those where
isSecure() returns true to have a SocketFactory for the
first hop would be great too.  This could be added via
a new Protocol constructor (so existing stuff doesn't
break) and by making the existing Protocol ctor use the
DefaultProtocolSocketFactory for the first hop by
default (as is currently embedded in the HttpConnection
code, I believe). Add this to the method to get this
socket factory I mentioned before. I'd be happy to add
these changes and send them to someone to check in (2
files for the Protocol stuff).

Of course, I have an ulterior motive - I would like to
contribute my changes to JXTA for enabling their TCP
protocol to tunnel through web proxies using
HttpClient. Without access to a Socket from HttpClient,
I would have to offer the JXTA changes as well as a
hacked version of HttpClient - not likely to help too
many people that way. 

Sorry for a delayed reply - I just got back from a
short ski trip on the Wapta Icefield (Banff National
Park, Rockies). Fun!

Regards,

/Mike Sample

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to