Is the java ProxySelector guaranteed to be called for ALL outgoing TCP requests?

Viewed 166

I'm developing a multi-threaded web application with a plugin architecture where the plugins will be making outbound calls to external systems. Plugins are free to use any client library they like for the system they are connecting to, provided the underlying protocol is TCP.

In some cases when I invoke a plugin I would like them to use a proxy (either SOCKS or HTTP) for their communication. Ideally I write a ProxySelector that can force the usage of the proxy I specify and have it be transparent to the plugin.

So the question - is the ProxySelector guaranteed to be called for any outbound (TCP) request they try to make?

On the same note, are all HTTP requests delivered to the ProxySelector as HTTP URIs, or is it possible some HTTP client library does its own low level magic that will only present in the ProxySelector as a socket:// URI ?

0 Answers
Related