@@ -110,6 +110,7 @@ public class AsyncHttpClientConfig {
110
110
protected boolean strict302Handling ;
111
111
protected int maxConnectionLifeTimeInMs ;
112
112
protected boolean useRelativeURIsWithSSLProxies ;
113
+ protected boolean spdyEnabled ;
113
114
114
115
protected AsyncHttpClientConfig () {
115
116
}
@@ -145,7 +146,8 @@ private AsyncHttpClientConfig(int maxTotalConnections,
145
146
HostnameVerifier hostnameVerifier ,
146
147
int ioThreadMultiplier ,
147
148
boolean strict302Handling ,
148
- boolean useRelativeURIsWithSSLProxies ) {
149
+ boolean useRelativeURIsWithSSLProxies ,
150
+ boolean spdyEnabled ) {
149
151
150
152
this .maxTotalConnections = maxTotalConnections ;
151
153
this .maxConnectionPerHost = maxConnectionPerHost ;
@@ -185,6 +187,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
185
187
}
186
188
this .proxyServer = proxyServer ;
187
189
this .useRawUrl = useRawUrl ;
190
+ this .spdyEnabled = spdyEnabled ;
188
191
}
189
192
190
193
/**
@@ -455,6 +458,13 @@ public boolean isUseRawUrl() {
455
458
return useRawUrl ;
456
459
}
457
460
461
+ /**
462
+ * @return whether or not SPDY is enabled.
463
+ */
464
+ public boolean isSpdyEnabled () {
465
+ return spdyEnabled ;
466
+ }
467
+
458
468
/**
459
469
* Return true if the query parameters will be stripped from the request when a redirect is requested.
460
470
*
@@ -575,6 +585,7 @@ public Thread newThread(Runnable r) {
575
585
private HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier ();
576
586
private int ioThreadMultiplier = 2 ;
577
587
private boolean strict302Handling ;
588
+ private boolean spdyEnabled ;
578
589
579
590
public Builder () {
580
591
}
@@ -1031,6 +1042,21 @@ public Builder setUseRelativeURIsWithSSLProxies(boolean useRelativeURIsWithSSLPr
1031
1042
return this ;
1032
1043
}
1033
1044
1045
+ /**
1046
+ * Enables SPDY support. Note that doing so, will currently disable WebSocket support
1047
+ * for this client instance. If not explicitly enabled, spdy will not be used.
1048
+ *
1049
+ * @param spdyEnabled configures spdy support.
1050
+ *
1051
+ * @return this
1052
+ *
1053
+ * @since 2.0
1054
+ */
1055
+ public Builder setSpdyEnabled (boolean spdyEnabled ) {
1056
+ this .spdyEnabled = spdyEnabled ;
1057
+ return this ;
1058
+ }
1059
+
1034
1060
/**
1035
1061
* Create a config builder with values taken from the given prototype configuration.
1036
1062
*
@@ -1124,7 +1150,8 @@ public AsyncHttpClientConfig build() {
1124
1150
hostnameVerifier ,
1125
1151
ioThreadMultiplier ,
1126
1152
strict302Handling ,
1127
- useRelativeURIsWithSSLProxies );
1153
+ useRelativeURIsWithSSLProxies ,
1154
+ spdyEnabled );
1128
1155
}
1129
1156
}
1130
1157
}
0 commit comments