JVM

【jvm&proxy】为 jvm配置代理

2022-05-14  本文已影响0人  Bogon

How do I set the proxy to be used by the JVM?

-Dhttp.proxyHost=127.0.0.1

-Dhttp.proxyPort=1080

-Dhttps.proxyHost=127.0.0.1

-Dhttps.proxyPort=1080

-Dhttp.proxyUser=username

-Dhttp.proxyPassword=password

-Dhttp.nonProxyHosts="localhost|127.0.0.1|10...|.example.com"

######################################################

应用示例:

# java   \

-Dhttp.proxyHost=10.10.10.10 \

-Dhttp.proxyPort=8080 \

-Dhttp.proxyUser=username \

-Dhttp.proxyPassword=password  \

-Dhttp.nonProxyHosts="localhost|127.0.0.1|www.example.com" \

-jar myJar.jar

注:

1. 10.10.10.10 8080 为示例代理的IP和PORT

2.http.nonProxyHosts ,注意中间是non,不是no

3. http.nonProxyHosts如果有多个,用英文符号 | 分割

image

参考

How do I set the proxy to be used by the JVM?

https://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm

Jvm Networking Properties

https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html

Linux上各类代理设置

https://www.jianshu.com/p/81c90d9cb69f

JVM设置HTTP代理

https://blog.csdn.net/wzl1369248650/article/details/104064638/

How to make maven use system proxy settings

https://stackoverflow.com/questions/3601474/how-to-make-maven-use-system-proxy-settings/3603093

Linux/CentOS设置HTTP全局代理

https://www.cnblogs.com/EasonJim/p/9826681.html

正确使用java -D命令行参数

https://www.jianshu.com/p/eda395fe12d1

chrome浏览器代理设置

https://zhidao.baidu.com/question/204679423955769445.html

上一篇下一篇

猜你喜欢

热点阅读