Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 968 Bytes

6-Proxy-EN.md

File metadata and controls

28 lines (23 loc) · 968 Bytes

← HTTPS Configurations | Proxy Configurations(中文) | Debug →


Proxy Configurations

Priority: Client > Environment variable

Support below environment variable:

  1. HTTP_PROXY or http_proxy
  2. HTTPS_PROXY
  3. NO_PROXY
// Client proxy configurations
HttpClientConfig clientConfig = HttpClientConfig.getDefault();
// Configure HTTP proxy
clientConfig.setHttpProxy("http://127.0.0.1:9898");
// Configure HTTPS proxy
clientConfig.setHttpsProxy("http://user:[email protected]:8989");
// Configure host addresses bypass the proxy
clientConfig.setNoProxy("127.0.0.1,localhost");

IClientProfile profile = DefaultProfile.getProfile(regionId, accesskeyId, accesskeySecret);
profile.setHttpClientConfig(clientConfig);
DefaultAcsClient client = new DefaultAcsClient(profile);

← HTTPS Configurations | Proxy Configurations(中文) | Debug →