本文介绍了使用 spring-boot 指定 http 代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为tomcat服务器运行spring-boot fat war时,如何指定要使用的http代理?

How do I specify a http proxy to use when running a spring-boot fat war as a tomcat server?

我尝试了以下方法但不起作用.

I have tried the following which is not working.

java -jar my-application.war --http.proxyHost=localhost --http.proxyPort=3128 --https.proxyHost=localhost --https.proxyPort=3128

java -jar my-application.war -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128

推荐答案

我发现我需要 -Dhttps.proxySet=true 才能实际使用代理配置.

I've found that I need -Dhttps.proxySet=true in order for the proxy config to actually be used.

这篇关于使用 spring-boot 指定 http 代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 19:03