ROME parses feed bytes; the HTTP client should own their proxy route and account. For a chosen JDK HttpClient, a fixed proxy belongs on its builder:

HttpClient client = HttpClient.newBuilder()
    .proxy(ProxySelector.of(
        new InetSocketAddress("proxy.example", 8080)))
    .build();

For a permitted public-feed test without proxy authentication, replace the placeholder host and port with a candidate from the HTTP proxy list. Add the deployment’s authentication and request limits to that client. After it obtains an acceptable response, hand the stream to ROME:

try (XmlReader reader = new XmlReader(body, contentType)) {
    SyndFeed feed = new SyndFeedInput().build(reader);
}

The modern imports are com.rometools.rome.io.XmlReader and SyndFeedInput. Here body is the received InputStream and contentType is the HTTP Content-Type. XmlReader considers the BOM, that metadata and the XML declaration. Decoding with an arbitrary charset first can discard useful evidence.

Inspect HTTP status before parsing. A proxy login page or denial can otherwise appear as an XML error. Release bodies for rejected responses too, so an HTTP error does not leave its stream open.

Two feed sources can use differently configured clients without mutating JVM proxy properties between calls. Each HTTP client owns its route while ROME owns the parsing step.

Ũhoro ũhĩtĩte