99
1010import io .weaviate .client6 .v1 .internal .BuildInfo ;
1111import io .weaviate .client6 .v1 .internal .ObjectBuilder ;
12+ import io .weaviate .client6 .v1 .internal .Proxy ;
1213import io .weaviate .client6 .v1 .internal .Timeout ;
1314import io .weaviate .client6 .v1 .internal .TokenProvider ;
1415import io .weaviate .client6 .v1 .internal .TransportOptions ;
@@ -24,7 +25,8 @@ public record Config(
2425 Map <String , String > headers ,
2526 Authentication authentication ,
2627 TrustManagerFactory trustManagerFactory ,
27- Timeout timeout ) {
28+ Timeout timeout ,
29+ Proxy proxy ) {
2830
2931 public static Config of (Function <Custom , ObjectBuilder <Config >> fn ) {
3032 return fn .apply (new Custom ()).build ();
@@ -40,23 +42,24 @@ private Config(Builder<?> builder) {
4042 builder .headers ,
4143 builder .authentication ,
4244 builder .trustManagerFactory ,
43- builder .timeout );
45+ builder .timeout ,
46+ builder .proxy );
4447 }
4548
4649 RestTransportOptions restTransportOptions () {
4750 return restTransportOptions (null );
4851 }
4952
5053 RestTransportOptions restTransportOptions (TokenProvider tokenProvider ) {
51- return new RestTransportOptions (scheme , httpHost , httpPort , headers , tokenProvider , trustManagerFactory , timeout );
54+ return new RestTransportOptions (scheme , httpHost , httpPort , headers , tokenProvider , trustManagerFactory , timeout , proxy );
5255 }
5356
5457 GrpcChannelOptions grpcTransportOptions () {
5558 return grpcTransportOptions (null );
5659 }
5760
5861 GrpcChannelOptions grpcTransportOptions (TokenProvider tokenProvider ) {
59- return new GrpcChannelOptions (scheme , grpcHost , grpcPort , headers , tokenProvider , trustManagerFactory , timeout );
62+ return new GrpcChannelOptions (scheme , grpcHost , grpcPort , headers , tokenProvider , trustManagerFactory , timeout , proxy );
6063 }
6164
6265 private abstract static class Builder <SelfT extends Builder <SelfT >> implements ObjectBuilder <Config > {
@@ -70,6 +73,7 @@ private abstract static class Builder<SelfT extends Builder<SelfT>> implements O
7073 protected TrustManagerFactory trustManagerFactory ;
7174 protected Timeout timeout = new Timeout ();
7275 protected Map <String , String > headers = new HashMap <>();
76+ protected Proxy proxy ;
7377
7478 /**
7579 * Set URL scheme. Subclasses may increase the visibility of this method to
@@ -175,6 +179,15 @@ public SelfT timeout(int initSeconds, int querySeconds, int insertSeconds) {
175179 return (SelfT ) this ;
176180 }
177181
182+ /**
183+ * Set proxy for all requests.
184+ */
185+ @ SuppressWarnings ("unchecked" )
186+ public SelfT proxy (Proxy proxy ) {
187+ this .proxy = proxy ;
188+ return (SelfT ) this ;
189+ }
190+
178191 /**
179192 * Weaviate will use the URL in this header to call Weaviate Embeddings
180193 * Service if an appropriate vectorizer is configured for collection.
0 commit comments