Package org.javacord.core.util.http
Class ProxyAuthenticator
- java.lang.Object
-
- org.javacord.core.util.http.ProxyAuthenticator
-
- All Implemented Interfaces:
okhttp3.Authenticator
public class ProxyAuthenticator extends Object implements okhttp3.Authenticator
This class bridges the system defaultAuthenticator
forBasic
auth and theAuthenticator
for any auth to the OkHttp proxy authenticator mechanism.
-
-
Constructor Summary
Constructors Constructor Description ProxyAuthenticator()
Creates a new proxy authenticator that is capable of doingBasic
auth with credentials from the system default authenticator.ProxyAuthenticator(Authenticator authenticator)
Creates a new proxy authenticator that requests the authentication headers to set from the given authenticator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.Request
authenticate(okhttp3.Route route, okhttp3.Response response)
-
-
-
Constructor Detail
-
ProxyAuthenticator
public ProxyAuthenticator()
Creates a new proxy authenticator that is capable of doingBasic
auth with credentials from the system default authenticator.
-
ProxyAuthenticator
public ProxyAuthenticator(Authenticator authenticator)
Creates a new proxy authenticator that requests the authentication headers to set from the given authenticator.- Parameters:
authenticator
- The authenticator to delegate work to.
-
-
Method Detail
-
authenticate
public okhttp3.Request authenticate(okhttp3.Route route, okhttp3.Response response) throws IOException
- Specified by:
authenticate
in interfaceokhttp3.Authenticator
- Throws:
IOException
-
-