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 classProxyConfig.ProxyConfigBuilder -
Method Summary
Modifier and Type Method Description voidapply(okhttp3.OkHttpClient.Builder builder)Applies this proxy configuration to an OkHttpClientvoidapplyWs(com.neovisionaries.ws.client.ProxySettings settings)Applies this proxy configuration to a websocket factory's settingsstatic ProxyConfig.ProxyConfigBuilderbuilder()protected booleancanEqual(java.lang.Object other)voidclearPassword()Clears the character array storing the proxy password.booleanequals(java.lang.Object o)okhttp3.AuthenticatorgetAuthenticator()@NonNull java.lang.StringgetHostname()The hostname or IP address of the proxy serverchar[]getPassword()The password used to authenticate with the proxy, if applicable@NonNull java.lang.IntegergetPort()The port of the proxy serverjava.net.ProxygetProxy()java.lang.StringgetUsername()The username used to authenticate with the proxy, if applicableinthashCode()java.lang.StringtoString()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
-
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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other) -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getProxy
public java.net.Proxy getProxy() -
getAuthenticator
public okhttp3.Authenticator getAuthenticator()
-