/
HttpClientOptions.java
787 lines (692 loc) · 22.6 KB
/
HttpClientOptions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
/*
* Copyright (c) 2011-2014 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package io.vertx.core.http;
import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonObject;
import io.vertx.core.net.ClientOptionsBase;
import io.vertx.core.net.JksOptions;
import io.vertx.core.net.PemKeyCertOptions;
import io.vertx.core.net.PemTrustOptions;
import io.vertx.core.net.PfxOptions;
import io.vertx.core.net.SSLEngine;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Options describing how an {@link HttpClient} will make connections.
*
* @author <a href="http://tfox.org">Tim Fox</a>
*/
@DataObject(generateConverter = true)
public class HttpClientOptions extends ClientOptionsBase {
/**
* The default maximum number of connections a client will pool = 5
*/
public static final int DEFAULT_MAX_POOL_SIZE = 5;
/**
* The default maximum number of concurrent stream per connection for HTTP/2 = -1
*/
public static final int DEFAULT_MAX_STREAMS = -1;
/**
* Default value of whether keep-alive is enabled = true
*/
public static final boolean DEFAULT_KEEP_ALIVE = true;
/**
* Default value of whether pipe-lining is enabled = false
*/
public static final boolean DEFAULT_PIPELINING = false;
/**
* Default value of whether the client will attempt to use compression = false
*/
public static final boolean DEFAULT_TRY_USE_COMPRESSION = false;
/**
* Default value of whether hostname verification (for SSL/TLS) is enabled = true
*/
public static final boolean DEFAULT_VERIFY_HOST = true;
/**
* The default value for maximum websocket frame size = 65536 bytes
*/
public static final int DEFAULT_MAX_WEBSOCKET_FRAME_SIZE = 65536;
/**
* The default value for host name = "localhost"
*/
public static final String DEFAULT_DEFAULT_HOST = "localhost";
/**
* The default value for port = 80
*/
public static final int DEFAULT_DEFAULT_PORT = 80;
/**
* The default protocol version = HTTP/1.1
*/
public static final HttpVersion DEFAULT_PROTOCOL_VERSION = HttpVersion.HTTP_1_1;
/**
* Default max HTTP chunk size = 8192
*/
public static final int DEFAULT_MAX_CHUNK_SIZE = 8192;
/**
* Default max wait queue size = -1 (unbounded)
*/
public static final int DEFAULT_MAX_WAIT_QUEUE_SIZE = -1;
/**
* Default Application-Layer Protocol Negotiation versions = [] (automatic according to protocol version)
*/
public static final List<HttpVersion> DEFAULT_ALPN_VERSIONS = Collections.emptyList();
/**
* Default using HTTP/1.1 upgrade for establishing an <i>h2C</i> connection = true
*/
public static final boolean DEFAULT_H2C_UPGRADE = true;
private boolean verifyHost = true;
private int maxPoolSize;
private boolean keepAlive;
private boolean pipelining;
private int maxStreams;
private boolean tryUseCompression;
private int maxWebsocketFrameSize;
private String defaultHost;
private int defaultPort;
private HttpVersion protocolVersion;
private int maxChunkSize;
private int maxWaitQueueSize;
private Http2Settings initialSettings;
private List<HttpVersion> alpnVersions;
private boolean h2cUpgrade;
private String proxyHost;
private int proxyPort;
private String proxyUsername;
private String proxyPassword;
/**
* Default constructor
*/
public HttpClientOptions() {
super();
init();
}
/**
* Copy constructor
*
* @param other the options to copy
*/
public HttpClientOptions(HttpClientOptions other) {
super(other);
this.verifyHost = other.isVerifyHost();
this.maxPoolSize = other.getMaxPoolSize();
this.keepAlive = other.isKeepAlive();
this.pipelining = other.isPipelining();
this.maxStreams = other.maxStreams;
this.tryUseCompression = other.isTryUseCompression();
this.maxWebsocketFrameSize = other.maxWebsocketFrameSize;
this.defaultHost = other.defaultHost;
this.defaultPort = other.defaultPort;
this.protocolVersion = other.protocolVersion;
this.maxChunkSize = other.maxChunkSize;
this.maxWaitQueueSize = other.maxWaitQueueSize;
this.initialSettings = other.initialSettings != null ? new Http2Settings(other.initialSettings) : null;
this.alpnVersions = other.alpnVersions != null ? new ArrayList<>(other.alpnVersions) : null;
this.h2cUpgrade = other.h2cUpgrade;
this.proxyHost = other.proxyHost;
this.proxyPort = other.proxyPort;
this.proxyUsername = other.proxyUsername;
this.proxyPassword = other.proxyPassword;
}
/**
* Constructor to create an options from JSON
*
* @param json the JSON
*/
public HttpClientOptions(JsonObject json) {
super(json);
init();
HttpClientOptionsConverter.fromJson(json, this);
}
private void init() {
verifyHost = DEFAULT_VERIFY_HOST;
maxPoolSize = DEFAULT_MAX_POOL_SIZE;
keepAlive = DEFAULT_KEEP_ALIVE;
pipelining = DEFAULT_PIPELINING;
maxStreams = DEFAULT_MAX_STREAMS;
tryUseCompression = DEFAULT_TRY_USE_COMPRESSION;
maxWebsocketFrameSize = DEFAULT_MAX_WEBSOCKET_FRAME_SIZE;
defaultHost = DEFAULT_DEFAULT_HOST;
defaultPort = DEFAULT_DEFAULT_PORT;
protocolVersion = DEFAULT_PROTOCOL_VERSION;
maxChunkSize = DEFAULT_MAX_CHUNK_SIZE;
maxWaitQueueSize = DEFAULT_MAX_WAIT_QUEUE_SIZE;
initialSettings = new Http2Settings();
alpnVersions = new ArrayList<>(DEFAULT_ALPN_VERSIONS);
h2cUpgrade = DEFAULT_H2C_UPGRADE;
proxyHost = null;
proxyPort = 0;
proxyUsername = null;
proxyPassword = null;
}
@Override
public HttpClientOptions setSendBufferSize(int sendBufferSize) {
super.setSendBufferSize(sendBufferSize);
return this;
}
@Override
public HttpClientOptions setReceiveBufferSize(int receiveBufferSize) {
super.setReceiveBufferSize(receiveBufferSize);
return this;
}
@Override
public HttpClientOptions setReuseAddress(boolean reuseAddress) {
super.setReuseAddress(reuseAddress);
return this;
}
@Override
public HttpClientOptions setTrafficClass(int trafficClass) {
super.setTrafficClass(trafficClass);
return this;
}
@Override
public HttpClientOptions setTcpNoDelay(boolean tcpNoDelay) {
super.setTcpNoDelay(tcpNoDelay);
return this;
}
@Override
public HttpClientOptions setTcpKeepAlive(boolean tcpKeepAlive) {
super.setTcpKeepAlive(tcpKeepAlive);
return this;
}
@Override
public HttpClientOptions setSoLinger(int soLinger) {
super.setSoLinger(soLinger);
return this;
}
@Override
public HttpClientOptions setUsePooledBuffers(boolean usePooledBuffers) {
super.setUsePooledBuffers(usePooledBuffers);
return this;
}
@Override
public HttpClientOptions setIdleTimeout(int idleTimeout) {
super.setIdleTimeout(idleTimeout);
return this;
}
@Override
public HttpClientOptions setSsl(boolean ssl) {
super.setSsl(ssl);
return this;
}
@Override
public HttpClientOptions setKeyStoreOptions(JksOptions options) {
super.setKeyStoreOptions(options);
return this;
}
@Override
public HttpClientOptions setPfxKeyCertOptions(PfxOptions options) {
return (HttpClientOptions) super.setPfxKeyCertOptions(options);
}
@Override
public HttpClientOptions setPemKeyCertOptions(PemKeyCertOptions options) {
return (HttpClientOptions) super.setPemKeyCertOptions(options);
}
@Override
public HttpClientOptions setTrustStoreOptions(JksOptions options) {
super.setTrustStoreOptions(options);
return this;
}
@Override
public HttpClientOptions setPfxTrustOptions(PfxOptions options) {
return (HttpClientOptions) super.setPfxTrustOptions(options);
}
@Override
public HttpClientOptions setPemTrustOptions(PemTrustOptions options) {
return (HttpClientOptions) super.setPemTrustOptions(options);
}
@Override
public HttpClientOptions addEnabledCipherSuite(String suite) {
super.addEnabledCipherSuite(suite);
return this;
}
@Override
public HttpClientOptions addEnabledSecureTransportProtocol(final String protocol) {
super.addEnabledSecureTransportProtocol(protocol);
return this;
}
@Override
public HttpClientOptions addCrlPath(String crlPath) throws NullPointerException {
return (HttpClientOptions) super.addCrlPath(crlPath);
}
@Override
public HttpClientOptions addCrlValue(Buffer crlValue) throws NullPointerException {
return (HttpClientOptions) super.addCrlValue(crlValue);
}
@Override
public HttpClientOptions setConnectTimeout(int connectTimeout) {
super.setConnectTimeout(connectTimeout);
return this;
}
@Override
public HttpClientOptions setTrustAll(boolean trustAll) {
super.setTrustAll(trustAll);
return this;
}
/**
* Get the maximum pool size for connections
*
* @return the maximum pool size
*/
public int getMaxPoolSize() {
return maxPoolSize;
}
/**
* Set the maximum pool size for connections
*
* @param maxPoolSize the maximum pool size
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setMaxPoolSize(int maxPoolSize) {
if (maxPoolSize < 1) {
throw new IllegalArgumentException("maxPoolSize must be > 0");
}
this.maxPoolSize = maxPoolSize;
return this;
}
/**
* @return the maximum number of concurrent streams for an HTTP/2 connection, {@literal -1} means
* no limit (default value)
*/
public int getMaxStreams() {
return maxStreams;
}
/**
* Set the maximum of concurrent concurrency for an HTTP/2 connection, this limits the number
* of streams the client will create for a connection. The effective number of stream for a
* connection can be lower than this value when the server has limited this value lower than
* this value.
* <p/>
* Setting a maximum to {@literal -1} means the client will not limit the concurrency and the client
* will use a single connection. {@literal -1} is the default value.
*
* @param maxStreams the maximum concurrent for a connection
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setMaxStreams(int maxStreams) {
this.maxStreams = maxStreams;
return this;
}
/**
* Is keep alive enabled on the client?
*
* @return true if enabled
*/
public boolean isKeepAlive() {
return keepAlive;
}
/**
* Set whether keep alive is enabled on the client
*
* @param keepAlive true if enabled
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setKeepAlive(boolean keepAlive) {
this.keepAlive = keepAlive;
return this;
}
/**
* Is pipe-lining enabled on the client
*
* @return true if pipe-lining is enabled
*/
public boolean isPipelining() {
return pipelining;
}
/**
* Set whether pipe-lining is enabled on the client
*
* @param pipelining true if enabled
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setPipelining(boolean pipelining) {
this.pipelining = pipelining;
return this;
}
/**
* Is hostname verification (for SSL/TLS) enabled?
*
* @return true if enabled
*/
public boolean isVerifyHost() {
return verifyHost;
}
/**
* Set whether hostname verification is enabled
*
* @param verifyHost true if enabled
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setVerifyHost(boolean verifyHost) {
this.verifyHost = verifyHost;
return this;
}
/**
* Is compression enabled on the client?
*
* @return true if enabled
*/
public boolean isTryUseCompression() {
return tryUseCompression;
}
/**
* Set whether compression is enabled
*
* @param tryUseCompression true if enabled
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setTryUseCompression(boolean tryUseCompression) {
this.tryUseCompression = tryUseCompression;
return this;
}
/**
* Get the maximum websocket framesize to use
*
* @return the max websocket framesize
*/
public int getMaxWebsocketFrameSize() {
return maxWebsocketFrameSize;
}
/**
* Set the max websocket frame size
*
* @param maxWebsocketFrameSize the max frame size, in bytes
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setMaxWebsocketFrameSize(int maxWebsocketFrameSize) {
this.maxWebsocketFrameSize = maxWebsocketFrameSize;
return this;
}
/**
* Get the default host name to be used by this client in requests if none is provided when making the request.
*
* @return the default host name
*/
public String getDefaultHost() {
return defaultHost;
}
/**
* Set the default host name to be used by this client in requests if none is provided when making the request.
*
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setDefaultHost(String defaultHost) {
this.defaultHost = defaultHost;
return this;
}
/**
* Get the default port to be used by this client in requests if none is provided when making the request.
*
* @return the default port
*/
public int getDefaultPort() {
return defaultPort;
}
/**
* Set the default port to be used by this client in requests if none is provided when making the request.
*
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setDefaultPort(int defaultPort) {
this.defaultPort = defaultPort;
return this;
}
/**
* Get the protocol version.
*
* @return the protocol version
*/
public HttpVersion getProtocolVersion() {
return protocolVersion;
}
/**
* Set the protocol version.
*
* @param protocolVersion the protocol version
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setProtocolVersion(HttpVersion protocolVersion) {
if (protocolVersion == null) {
throw new IllegalArgumentException("protocolVersion must not be null");
}
this.protocolVersion = protocolVersion;
return this;
}
/**
* Set the maximum HTTP chunk size
* @param maxChunkSize the maximum chunk size
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setMaxChunkSize(int maxChunkSize) {
this.maxChunkSize = maxChunkSize;
return this;
}
/**
* Returns the maximum HTTP chunk size
* @return the maximum HTTP chunk size
*/
public int getMaxChunkSize() {
return maxChunkSize;
}
/**
* Set the maximum requests allowed in the wait queue, any requests beyond the max size will result in
* a ConnectionPoolTooBusyException. If the value is set to a negative number then the queue will be unbounded.
* @param maxWaitQueueSize the maximum number of waiting requests
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setMaxWaitQueueSize(int maxWaitQueueSize) {
this.maxWaitQueueSize = maxWaitQueueSize;
return this;
}
/**
* Returns the maximum wait queue size
* @return the maximum wait queue size
*/
public int getMaxWaitQueueSize() {
return maxWaitQueueSize;
}
/**
* @return the initial HTTP/2 connection settings
*/
public Http2Settings getInitialSettings() {
return initialSettings;
}
/**
* Set the HTTP/2 connection settings immediately sent by to the server when the client connects.
*
* @param settings the settings value
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setInitialSettings(Http2Settings settings) {
this.initialSettings = settings;
return this;
}
@Override
public HttpClientOptions setUseAlpn(boolean useAlpn) {
return (HttpClientOptions) super.setUseAlpn(useAlpn);
}
@Override
public HttpClientOptions setSslEngine(SSLEngine sslEngine) {
return (HttpClientOptions) super.setSslEngine(sslEngine);
}
/**
* @return the list of protocol versions to provide during the Application-Layer Protocol Negotiation. When
* the list is empty, the client provides a best effort list according to {@link #setProtocolVersion}
*/
public List<HttpVersion> getAlpnVersions() {
return alpnVersions;
}
/**
* Set the list of protocol versions to provide to the server during the Application-Layer Protocol Negotiation.
* When the list is empty, the client provides a best effort list according to {@link #setProtocolVersion}:
*
* <ul>
* <li>{@link HttpVersion#HTTP_2}: [ "h2", "http/1.1" ]</li>
* <li>otherwise: [{@link #getProtocolVersion()}]</li>
* </ul>
*
* @param alpnVersions the versions
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setAlpnVersions(List<HttpVersion> alpnVersions) {
this.alpnVersions = alpnVersions;
return this;
}
/**
* @return true when an <i>h2c</i> connection is established using an HTTP/1.1 upgrade request, false when directly
*/
public boolean isH2cUpgrade() {
return h2cUpgrade;
}
/**
* Set to {@code true} when an <i>h2c</i> connection is established using an HTTP/1.1 upgrade request, and {@code false}
* when an <i>h2c</i> connection is established directly (with prior knowledge).
*
* @param value the upgrade value
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setH2cUpgrade(boolean value) {
this.h2cUpgrade = value;
return this;
}
public HttpClientOptions setMetricsName(String metricsName) {
return (HttpClientOptions) super.setMetricsName(metricsName);
}
/**
* Set proxy hostname for ssl connections via CONNECT proxy (e.g. Squid).
*
* @param proxyHost proxy hostname to use for ssl connections
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setProxyHost(String proxyHost) {
this.proxyHost = proxyHost;
return this;
}
/**
* Get proxy hostname for ssl connections
*
* @return proxy hostname
*/
public String getProxyHost() {
return proxyHost;
}
/**
* Set proxy port for ssl connections
*
* @param proxyPort proxy port to use for ssl connections
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
return this;
}
/**
* Get proxy port for ssl connections
*
* @return proxy port
*/
public int getProxyPort() {
return proxyPort;
}
/**
* Set proxy username for ssl connections
*
* @param proxyUsername username for Proxy Authentication header
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setProxyUsername(String proxyUsername) {
this.proxyUsername = proxyUsername;
return this;
}
/**
* Get proxy username for ssl connections
*
* @return proxy username
*/
public String getProxyUsername() {
return proxyUsername;
}
/**
* Set proxy password for ssl connections
*
* @param proxyPassword password for Proxy Authentication header
* @return a reference to this, so the API can be used fluently
*/
public HttpClientOptions setProxyPassword(String proxyPassword) {
this.proxyPassword = proxyPassword;
return this;
}
/**
* Get proxy password for ssl connections
*
* @return proxy password
*/
public String getProxyPassword() {
return proxyPassword;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof HttpClientOptions)) return false;
if (!super.equals(o)) return false;
HttpClientOptions that = (HttpClientOptions) o;
if (defaultPort != that.defaultPort) return false;
if (keepAlive != that.keepAlive) return false;
if (maxPoolSize != that.maxPoolSize) return false;
if (maxStreams != that.maxStreams) return false;
if (maxWebsocketFrameSize != that.maxWebsocketFrameSize) return false;
if (pipelining != that.pipelining) return false;
if (tryUseCompression != that.tryUseCompression) return false;
if (verifyHost != that.verifyHost) return false;
if (!defaultHost.equals(that.defaultHost)) return false;
if (protocolVersion != that.protocolVersion) return false;
if (maxChunkSize != that.maxChunkSize) return false;
if (maxWaitQueueSize != that.maxWaitQueueSize) return false;
if (initialSettings == null ? that.initialSettings != null : !initialSettings.equals(that.initialSettings)) return false;
if (alpnVersions == null ? that.alpnVersions != null : !alpnVersions.equals(that.alpnVersions)) return false;
if (h2cUpgrade != that.h2cUpgrade) return false;
if (proxyHost == null ? that.proxyHost != null : !proxyHost.equals(that.proxyHost)) return false;
if (proxyPort != that.proxyPort) return false;
if (proxyUsername == null ? that.proxyUsername != null : !proxyUsername.equals(that.proxyUsername)) return false;
if (proxyPassword == null ? that.proxyPassword != null : !proxyPassword.equals(that.proxyPassword)) return false;
return true;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (verifyHost ? 1 : 0);
result = 31 * result + maxPoolSize;
result = 31 * result + maxStreams;
result = 31 * result + (keepAlive ? 1 : 0);
result = 31 * result + (pipelining ? 1 : 0);
result = 31 * result + (tryUseCompression ? 1 : 0);
result = 31 * result + maxWebsocketFrameSize;
result = 31 * result + defaultHost.hashCode();
result = 31 * result + defaultPort;
result = 31 * result + protocolVersion.hashCode();
result = 31 * result + maxChunkSize;
result = 31 * result + maxWaitQueueSize;
result = 31 * result + (initialSettings != null ? initialSettings.hashCode() : 0);
result = 31 * result + (alpnVersions != null ? alpnVersions.hashCode() : 0);
result = 31 * result + (h2cUpgrade ? 1 : 0);
result = 31 * result + (proxyHost != null ? proxyHost.hashCode() : 0);
result = 31 * result + proxyPort;
result = 31 * result + (proxyUsername != null ? proxyUsername.hashCode() : 0);
result = 31 * result + (proxyPassword != null ? proxyPassword.hashCode() : 0);
return result;
}
}