Closed mohammadchehab closed 3 years ago
hello,
working on your question
Assuming you have HTTP proxy, could, you, please, try this
var proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy_host", 8083));
var proxyAuthenticator = new Authenticator() {
@Override
public Request authenticate(@Nullable Route route, Response response) throws IOException {
String credential = Credentials.basic(username, password);
return response.request().newBuilder()
.header("Proxy-Authorization", credential)
.build();
}
};
var http_client = new OkHttpClient.Builder()
.proxy(proxy)
.proxyAuthenticator(proxyAuthenticator)
.build();
var api_client = new ApiClient(http_client);
api_client.setBasePath("https://some_url_where_document_reader_started:8080/");
var api = new DocumentReaderApi(api_client);
In general, we use okhttp3 as HTTP client. You can find more options available in OkHttpClient.Builder() in okhttp3 docs.
Waiting your feedback :)
I suppose this wont work with java 8 without adding the okhttp3 to my pom file, do you have any specific version.
our lib bundled with com.squareup.okhttp3:okhttp:3.14.7
dependency in maven metadata. Thus, if you install our lib, maven/gradle should implicitly include okhttp3.
btw, here you can find actual versions of dependencies we use
hello @chehabz,
Did you succeed with proxy integration?
Unfortunately no as we’re planning to host the soln on azure on our environment.
On Tue, 20 Apr 2021 at 10:52 AM Hleb Albau @.***> wrote:
hello @chehabz https://github.com/chehabz,
Did you succeed with proxy integration?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/regulaforensics/DocumentReader-web-java-client/issues/28#issuecomment-823022119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIC3AYA3MW7DDNJEW5LI2DTJUQCRANCNFSM42Y6RUPQ .
close as stale
how can you set the HTTP proxy? need a username password and a server + port