Class ProxyConfig

java.lang.Object
com.github.twitch4j.common.config.ProxyConfig

public class ProxyConfig extends Object
Wrapper around a HTTP(S) proxy to be used by Twitch4J modules
  • Method Details

    • apply

      public void apply(okhttp3.OkHttpClient.Builder builder)
      Applies this proxy configuration to an OkHttpClient
      Parameters:
      builder - the builder of the Http Client
    • clearPassword

      public void clearPassword()
      Clears the character array storing the proxy password. Call this method once the proxy is no longer in use to reduce the likelihood of the password being accessible in memory
    • builder

      public static ProxyConfig.ProxyConfigBuilder builder()
    • getHostname

      @NonNull public @NonNull String getHostname()
      The hostname or IP address of the proxy server
    • getPort

      @NonNull public @NonNull Integer getPort()
      The port of the proxy server
    • getUsername

      public String getUsername()
      The username used to authenticate with the proxy, if applicable
    • getPassword

      public char[] getPassword()
      The password used to authenticate with the proxy, if applicable
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProxy

      public Proxy getProxy()
    • getAuthenticator

      public okhttp3.Authenticator getAuthenticator()