@@ -83,7 +83,7 @@ public class AsyncHttpClientConfig {
83
83
protected HostnameVerifier hostnameVerifier ;
84
84
protected int ioThreadMultiplier ;
85
85
protected boolean strict302Handling ;
86
- protected boolean useRelativeURIsWithSSLProxies ;
86
+ protected boolean useRelativeURIsWithConnectProxies ;
87
87
protected int maxConnectionLifeTimeInMs ;
88
88
protected TimeConverter timeConverter ;
89
89
@@ -120,7 +120,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
120
120
HostnameVerifier hostnameVerifier ,
121
121
int ioThreadMultiplier ,
122
122
boolean strict302Handling ,
123
- boolean useRelativeURIsWithSSLProxies ,
123
+ boolean useRelativeURIsWithConnectProxies ,
124
124
TimeConverter timeConverter ) {
125
125
126
126
this .maxTotalConnections = maxTotalConnections ;
@@ -151,7 +151,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
151
151
this .hostnameVerifier = hostnameVerifier ;
152
152
this .ioThreadMultiplier = ioThreadMultiplier ;
153
153
this .strict302Handling = strict302Handling ;
154
- this .useRelativeURIsWithSSLProxies = useRelativeURIsWithSSLProxies ;
154
+ this .useRelativeURIsWithConnectProxies = useRelativeURIsWithConnectProxies ;
155
155
156
156
if (applicationThreadPool == null ) {
157
157
this .applicationThreadPool = Executors .newCachedThreadPool ();
@@ -494,15 +494,27 @@ public boolean isStrict302Handling() {
494
494
}
495
495
496
496
/**
497
- * @return<code>true</code> if AHC should use relative URIs instead of absolute ones when talking with a SSL proxy,
498
- * otherwise <code>false</code>.
497
+ * @return<code>true</code> if AHC should use relative URIs instead of absolute ones when talking with a SSL proxy
498
+ * or WebSocket proxy, otherwise <code>false</code>.
499
499
*
500
500
* @since 1.7.12
501
+ * @deprecated Use isUseRelativeURIsWithConnectProxies instead.
501
502
*/
503
+ @ Deprecated
502
504
public boolean isUseRelativeURIsWithSSLProxies () {
503
- return useRelativeURIsWithSSLProxies ;
505
+ return useRelativeURIsWithConnectProxies ;
506
+ }
507
+
508
+ /**
509
+ * @return<code>true</code> if AHC should use relative URIs instead of absolute ones when talking with a proxy
510
+ * using the CONNECT method, for example when using SSL or WebSockets.
511
+ *
512
+ * @since 1.8.13
513
+ */
514
+ public boolean isUseRelativeURIsWithConnectProxies () {
515
+ return useRelativeURIsWithConnectProxies ;
504
516
}
505
-
517
+
506
518
/**
507
519
* Return the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} will keep connection in the pool, or -1 to keep connection while possible.
508
520
*
@@ -538,7 +550,7 @@ public static class Builder {
538
550
private boolean useProxyProperties = defaultUseProxyProperties ();
539
551
private boolean useProxySelector = defaultUseProxySelector ();
540
552
private boolean allowPoolingConnection = defaultAllowPoolingConnection ();
541
- private boolean useRelativeURIsWithSSLProxies = defaultUseRelativeURIsWithSSLProxies ();
553
+ private boolean useRelativeURIsWithConnectProxies = defaultUseRelativeURIsWithConnectProxies ();
542
554
private int requestCompressionLevel = defaultRequestCompressionLevel ();
543
555
private int maxRequestRetry = defaultMaxRequestRetry ();
544
556
private int ioThreadMultiplier = defaultIoThreadMultiplier ();
@@ -1005,15 +1017,31 @@ public Builder setStrict302Handling(final boolean strict302Handling) {
1005
1017
}
1006
1018
1007
1019
/**
1008
- * Configures this AHC instance to use relative URIs instead of absolute ones when talking with a SSL proxy.
1020
+ * Configures this AHC instance to use relative URIs instead of absolute ones when talking with a SSL proxy or
1021
+ * WebSocket proxy.
1009
1022
*
1010
1023
* @param useRelativeURIsWithSSLProxies
1011
1024
* @return this
1012
1025
*
1013
1026
* @since 1.7.2
1027
+ * @deprecated Use setUseRelativeURIsWithConnectProxies instead.
1014
1028
*/
1015
1029
public Builder setUseRelativeURIsWithSSLProxies (boolean useRelativeURIsWithSSLProxies ) {
1016
- this .useRelativeURIsWithSSLProxies = useRelativeURIsWithSSLProxies ;
1030
+ this .useRelativeURIsWithConnectProxies = useRelativeURIsWithSSLProxies ;
1031
+ return this ;
1032
+ }
1033
+
1034
+ /**
1035
+ * Configures this AHC instance to use relative URIs instead of absolute ones when making requests through
1036
+ * proxies using the CONNECT method, such as when making SSL requests or WebSocket requests.
1037
+ *
1038
+ * @param useRelativeURIsWithConnectProxies
1039
+ * @return this
1040
+ *
1041
+ * @since 1.8.13
1042
+ */
1043
+ public Builder setUseRelativeURIsWithConnectProxies (boolean useRelativeURIsWithConnectProxies ) {
1044
+ this .useRelativeURIsWithConnectProxies = useRelativeURIsWithConnectProxies ;
1017
1045
return this ;
1018
1046
}
1019
1047
@@ -1139,7 +1167,7 @@ public Thread newThread(Runnable r) {
1139
1167
hostnameVerifier ,
1140
1168
ioThreadMultiplier ,
1141
1169
strict302Handling ,
1142
- useRelativeURIsWithSSLProxies ,
1170
+ useRelativeURIsWithConnectProxies ,
1143
1171
timeConverter );
1144
1172
}
1145
1173
}
0 commit comments