コード例 #1
0
 /**
  * Specify proxy that should be used to connect.
  *
  * @param proxyHost Hostname of proxy.
  * @param proxyPort Port of proxy.
  * @return the current {@link Builder} instance
  */
 public Builder proxy(String proxyHost, int proxyPort) {
   if (proxy == null) {
     proxy = new ProxyConfig(Proxy.Type.HTTP);
   }
   proxy.setProxyHost(proxyHost);
   proxy.setProxyPort(proxyPort);
   return this;
 }
コード例 #2
0
 /**
  * Configure type of proxy.
  *
  * @param proxyType Type of proxy as
  * @return the current {@link Builder} instance
  */
 public Builder proxyType(Proxy.Type proxyType) {
   if (proxy == null) {
     proxy = new ProxyConfig(Proxy.Type.HTTP);
   }
   proxy.setProxyType(proxyType);
   return this;
 }
コード例 #3
0
 /**
  * Sets password used with specified user.
  *
  * @param proxyPassword Password for user authentication.
  * @return the current {@link Builder} instance
  */
 public Builder proxyPassword(String proxyPassword) {
   if (proxy == null) {
     proxy = new ProxyConfig(Proxy.Type.HTTP);
   }
   proxy.setProxyPassword(proxyPassword);
   return this;
 }
コード例 #4
0
 /**
  * If proxy needs authentication, specify User.
  *
  * @param proxyUser Username for authentication.
  * @return the current {@link Builder} instance
  */
 public Builder proxyUser(String proxyUser) {
   if (proxy == null) {
     proxy = new ProxyConfig(Proxy.Type.HTTP);
   }
   proxy.setProxyUser(proxyUser);
   return this;
 }