Is Java ProxySelector guaranteed to invoke ALL outgoing TCP requests?

I am developing a multi-threaded web application with a plugin architecture where the plugins will send outgoing calls to external systems. The plugins are free to use any client library they like for the plugin system as long as the underlying protocol is TCP.

In some cases, when I call the plugin, I would like them to use a proxy (SOCKS or HTTP) for their communication. Ideally, I am writing a ProxySelector that can enforce the proxy I specify and have it transparent to the plugin.

So the question is, is the ProxySelector guaranteed for whatever outgoing (TCP) request they try to make?

At the same time, all HTTP requests passed to ProxySelector as HTTP URI, or perhaps some HTTP client library does its low level magic that will only be present in ProxySelector as socket: // URI?

+3


source to share





All Articles