简体   繁体   English

SeedStack,代理配置,而在假客户端期间进行休息 api 调用?

[英]SeedStack , proxy configuration while doing rest api call during feign client?

I was doing one sipmle rest api call using feign client but upable to call rest api as it was not passing because of proxy.我正在使用 feign 客户端进行一个 sipmle rest api 调用,但可以调用 rest api,因为它没有通过代理。 I tried setting up System.setProperties(props);我尝试设置 System.setProperties(props); props contain proxy url, and port no. props 包含代理 url 和端口号。 but still it is unable to do rest call.但仍然无法进行休息呼叫。 Can you please tell me how to configure proxy in seedstack using feign client.你能告诉我如何使用 feign 客户端在种子堆栈中配置代理吗?

By default, SeedStack will automatically configure a JVM-wide proxy using the (relatively) standard http_proxy , https_proxy and no_proxy environment variables.默认情况下,SeedStack 将使用(相对)标准的http_proxyhttps_proxyno_proxy环境变量自动配置 JVM 范围的代理。

  • The http_proxy and https_proxy variables should have the following format: http_proxyhttps_proxy变量应具有以下格式:

     http[s]://[user:password@]proxy.example.com:8080
  • The no_proxy variable is a comma-separated list of exclusion patterns: no_proxy变量是以逗号分隔的排除模式列表:

     *.domain.com, *.other.com

If you want to specify proxy configuration manually, you can do so in the application.yaml file:如果要手动指定代理配置,可以在application.yaml文件中进行:

proxy:
  mode: ENABLED|DISABLED|AUTO
  httpProxy: ...
  httpsProxy: ...
  noProxy: ...
  • The mode property determines if the proxy should be always enabled, always disabled or automatic based on the environment variables (the default). mode属性根据环境变量(默认值)确定是否应始终启用、始终禁用或自动代理。
  • Other properties should have the same format as their environment variable counterparts.其他属性应该与它们的环境变量对应物具有相同的格式。

When a proxy is configured (automatically or manually) a log will be printed at application startup.配置代理(自动或手动)后,将在应用程序启动时打印日志。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM