简体   繁体   English

如何在没有系统属性的 java URL Connection 中设置 http.nonProxyHosts?

[英]How to set http.nonProxyHosts in java URL Connection without system property?

I have a system property to exclude hosts to not use proxy.我有一个系统属性来排除主机不使用代理。 Is it possible to set it without setting the system properties?是否可以在不设置系统属性的情况下进行设置?

是的,您创建了一个java.net.Proxy ,然后在需要的情况下使用URL.openConnection(Proxy) ,在不需要的情况下使用Proxy.NONE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 系统属性http.nonProxyHosts设置为local | * .local…是什么意思? 这意味着什么? - What does System property http.nonProxyHosts has been set to local|*.local… mean? And what are the implications? http.nonProxyHosts的有效正则表达式 - Valid regex for http.nonProxyHosts 仅在本地主机上忽略 http.nonProxyHosts - http.nonProxyHosts ignored on localhost only 如何为 SOCKS 代理设置 nonProxyHosts? - How to set nonProxyHosts for a SOCKS proxy? Java中的nonProxyHosts属性的有效正则表达式格式是什么? - What are the valid regular expression formats for the nonProxyHosts property in Java? 如何设置java系统属性,以便每当我启动JVM而不将其添加到命令行参数时它都有效 - How to set a java system property so that it is effective whenever I start JVM without adding it to the command line arguments 如何在 Java 中设置 oracle CONNECTION_PROPERTY.NET_KEEPALIVE 属性 - How to set oracle CONNECTION_PROPERTY_NET_KEEPALIVE property in Java java URL连接设置cookie - java url connection set cookie 如何在AWS Java SDK中设置连接类型? -HTTPS与HTTP - How to set connection type in AWS Java SDK? - HTTPS vs HTTP Tomcat:如何在Netbeans中设置Java系统属性? - Tomcat: How do I set up a Java system property in Netbeans?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM