Skip to content

Commit c2a399c

Browse files
committed
state in readme that we support HTTP/2 and how to disable it
1 parent 164169a commit c2a399c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This library provides the following:
77
3. Streaming body download
88
4. TLS support
99
5. Cookie parsing (but not storage)
10+
6. Automatic HTTP/2 over HTTPS (since version 1.7.0)
1011

1112
---
1213

@@ -216,7 +217,7 @@ httpClient.execute(
216217
).whenComplete (...)
217218
```
218219

219-
Direct URLs can easily be contructed to be executed in other scenarios:
220+
Direct URLs can easily be constructed to be executed in other scenarios:
220221
```swift
221222
let socketPathBasedURL = URL(
222223
httpURLWithSocketPath: "/tmp/myServer.socket",
@@ -228,6 +229,17 @@ let secureSocketPathBasedURL = URL(
228229
)
229230
```
230231

232+
### Disabling HTTP/2
233+
The exclusive use of HTTP/1 is possible by setting `httpVersion` to `.http1Only` in `HTTPClient.Configuration`:
234+
```
235+
var configuration = HTTPClient.Configuration()
236+
configuration.httpVersion = .http1Only
237+
let client = HTTPClient(
238+
eventLoopGroupProvider: .createNew,
239+
configuration: configuration
240+
)
241+
```
242+
231243
## Security
232244

233245
Please have a look at [SECURITY.md](SECURITY.md) for AsyncHTTPClient's security process.

0 commit comments

Comments
 (0)