我的项目生产环境访问外网https接口需要通过代理访问,我百度了都是加以下语句:
System.setProperty("http.proxyHost", "代理ip");
System.setProperty("http.proxyPort", "3128");
System.setProperty("https.proxyHost", "代理ip");
System.setProperty("https.proxyPort", "3128");
请问这些语句在项目哪里添加?可否提供源代码参考一下?谢谢。
写main方法里,SpringApplication.run 执行之前