Class ProxyConfig

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

public class ProxyConfig
extends java.lang.Object
Wrapper around a HTTP(S) proxy to be used by Twitch4J modules
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  ProxyConfig.ProxyConfigBuilder  
  • Method Summary

    Modifier and Type Method Description
    void apply​(okhttp3.OkHttpClient.Builder builder)
    Applies this proxy configuration to an OkHttpClient
    void applyWs​(com.neovisionaries.ws.client.ProxySettings settings)
    Applies this proxy configuration to a websocket factory's settings
    static ProxyConfig.ProxyConfigBuilder builder()  
    protected boolean canEqual​(java.lang.Object other)  
    void clearPassword()
    Clears the character array storing the proxy password.
    boolean equals​(java.lang.Object o)  
    okhttp3.Authenticator getAuthenticator()  
    @NonNull java.lang.String getHostname()
    The hostname or IP address of the proxy server
    char[] getPassword()
    The password used to authenticate with the proxy, if applicable
    @NonNull java.lang.Integer getPort()
    The port of the proxy server
    java.net.Proxy getProxy()  
    java.lang.String getUsername()
    The username used to authenticate with the proxy, if applicable
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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
    • applyWs

      public void applyWs​(com.neovisionaries.ws.client.ProxySettings settings)
      Applies this proxy configuration to a websocket factory's settings
      Parameters:
      settings - WebSocket's proxy settings
    • 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 java.lang.String getHostname()
      The hostname or IP address of the proxy server
    • getPort

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

      public java.lang.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​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • canEqual

      protected boolean canEqual​(java.lang.Object other)
    • hashCode

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

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

      public java.net.Proxy getProxy()
    • getAuthenticator

      public okhttp3.Authenticator getAuthenticator()