@@ -9,7 +9,7 @@ use std::str::FromStr;
99use std:: time:: Duration ;
1010use temporal_client:: {
1111 ClientKeepAliveConfig , ClientOptions as CoreClientOptions , ClientOptionsBuilder ,
12- ClientTlsConfig , CloudService , ConfiguredClient , HealthService , OperatorService , RetryClient ,
12+ ClientTlsConfig , CloudService , ConfiguredClient , HealthService , HttpConnectProxyOptions , OperatorService , RetryClient ,
1313 RetryConfig , TemporalServiceClientWithMetrics , TestService , TlsConfig , WorkflowService ,
1414} ;
1515use tonic:: metadata:: MetadataKey ;
@@ -26,6 +26,7 @@ pub struct ClientOptions {
2626 tls_options : * const ClientTlsOptions ,
2727 retry_options : * const ClientRetryOptions ,
2828 keep_alive_options : * const ClientKeepAliveOptions ,
29+ http_connect_proxy_options : * const ClientHttpConnectProxyOptions ,
2930}
3031
3132#[ repr( C ) ]
@@ -52,6 +53,13 @@ pub struct ClientKeepAliveOptions {
5253 pub timeout_millis : u64 ,
5354}
5455
56+ #[ repr( C ) ]
57+ pub struct ClientHttpConnectProxyOptions {
58+ pub target_host : ByteArrayRef ,
59+ pub username : ByteArrayRef ,
60+ pub password : ByteArrayRef ,
61+ }
62+
5563type CoreClient = RetryClient < ConfiguredClient < TemporalServiceClientWithMetrics > > ;
5664
5765pub struct Client {
@@ -576,3 +584,16 @@ impl From<&ClientKeepAliveOptions> for ClientKeepAliveConfig {
576584 }
577585 }
578586}
587+
588+ impl From < & ClientHttpConnectProxyOptions > for HttpConnectProxyOptions {
589+ fn from ( opts : & ClientHttpConnectProxyOptions ) -> Self {
590+ HttpConnectProxyOptions {
591+ target_addr : opts. target_host . to_string ( ) ,
592+ basic_auth : if opts. username . size != 0 && opts. password . size != 0 {
593+ Some ( ( opts. username . to_string ( ) , opts. password . to_string ( ) ) )
594+ } else {
595+ None
596+ } ,
597+ }
598+ }
599+ }
0 commit comments