Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying an http proxy with spring-boot

Tags:

spring-boot

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

and

java -jar my-application.war -Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=3128
like image 524
jax Avatar asked Nov 27 '15 06:11

jax


People also ask

What is proxy server in spring boot?

A reverse proxy server is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client, as if they were originated from the proxy server itself.

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

Set the JVM flags http. proxyHost and http. proxyPort when starting your JVM on the command line. This is usually done in a shell script (in Unix) or bat file (in Windows).


1 Answers

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

like image 164
Myles Avatar answered Sep 17 '22 16:09

Myles