← HTTPS Configurations | Proxy Configurations(中文) | Debug →
Priority: Client > Environment variable
Support below environment variable:
- HTTP_PROXY or http_proxy
- HTTPS_PROXY
- 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 →