You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.md
+15-22
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,20 @@
1
-
### 0.7.0-rc2
1
+
### 0.7.0
2
2
3
-
* Include Brotli and zstd deps by default, remove code treating them as optional
4
-
5
-
Contribution by Matthew Davidson.
6
-
7
-
### 0.7.0-rc1
8
-
9
-
* Added HTTP/2 server support
3
+
* HTTP/2 server support, including ALPN and h2c
4
+
* HTTP/2 client support
10
5
* Support more compression codecs (Brotli, Zstd, and Snappy)
11
-
12
-
Contributions by Matthew Davidson, Moritz Heidkamp, and Arnaud Geiser.
13
-
14
-
### 0.7.0-alpha2
15
-
16
-
* Enable SSL/TLS certificate hostname verification by default in the client. (Warning: This is a BREAKING change for those with misconfigured server certificat~es.)
17
-
18
-
Contribution by Moritz Heidkamp.
19
-
20
-
### 0.7.0-alpha1
21
-
22
-
* Add support for HTTP/2 in the client.
23
-
24
-
Contributions by Matthew Davidson and Arnaud Geiser.
6
+
* Enable SSL/TLS certificate hostname verification by default in the client for
7
+
security purposes. (Warning: This is a BREAKING change for those with
8
+
misconfigured server certificates.)
9
+
* Bump Manifold dep to 0.4.1, which means Aleph/Manifold deferreds now support
10
+
CompletionStage for better Java interop
11
+
* Bump Netty to 4.1.00.Final
12
+
* Improved error logging
13
+
14
+
Contributions by Matthew Davidson, Moritz Heidkamp, and Arnaud Geiser.
15
+
16
+
Manifold contributions by Renan Ribeiro, Ryan Smith, Arnaud Geiser, and Matthew
The body of the response may also be a Manifold stream, where each message from the stream is sent as a chunk, allowing for precise control over streamed responses for [server-sent events](http://en.wikipedia.org/wiki/Server-sent_events) and other purposes.
37
44
45
+
38
46
#### Client
39
47
40
48
For HTTP client requests, Aleph models itself after [clj-http](https://github.com/dakrone/clj-http), except that every request immediately returns a Manifold deferred representing the response.
41
49
42
50
```clojure
43
51
(require
52
+
'[aleph.http :as http]
44
53
'[manifold.deferred :as d]
45
54
'[clj-commons.byte-streams :as bs])
46
55
@@ -53,6 +62,12 @@ For HTTP client requests, Aleph models itself after [clj-http](https://github.co
Aleph attempts to mimic the clj-http API and capabilities fully. It supports multipart/form-data requests, cookie stores, proxy servers and requests inspection with a few notable differences:
@@ -77,6 +92,22 @@ Aleph client also supports fully async and [highly customizable](https://github.
77
92
78
93
To learn more, [read the example code](https://github.com/clj-commons/aleph/blob/master/examples/src/aleph/examples/http.clj).
79
94
95
+
#### HTTP/2
96
+
97
+
As of 0.7.0, Aleph supports HTTP/2 in both the client and the server.
98
+
99
+
For the most part, Aleph's HTTP/2 support is a drop-in replacement for HTTP/1. For backwards compatibility, though, Aleph defaults to HTTP/1-only. See the [the example HTTP/2 code](https://github.com/clj-commons/aleph/blob/master/examples/src/aleph/examples/http2.clj) for a good overview on getting started with HTTP/2.
100
+
101
+
Things to be aware of:
102
+
103
+
1. Multipart uploads are not yet supported under HTTP/2, because Netty doesn't support them under HTTP/2. For new development, open a new H2 stream/request for each file instead. (HTTP/2 generally doesn't need multipart, since it doesn't have the same limitations on the number of connections as HTTP/1.) For existing multipart code, stick with HTTP/1. Ideally, this will be added in a future release.
104
+
2. Aleph does not currently support the CONNECT method under HTTP/2. Stick with HTTP/1 if you're using CONNECT.
105
+
3. Aleph will not support HTTP/2 server push, since it's deprecated, and effectively disabled by Chrome.
106
+
4. Aleph does not currently support HTTP/2 trailers (headers arriving after the body).
107
+
5. Aleph does nothing with priority information. We would like to expose an API to support user use of prioritization, but the browsers never agreed on how to interpret them, and some (e.g., Safari) effectively never used them. We think back-porting the HTTP/3 priority headers to HTTP/2 is a better aim.
108
+
6. Aleph currently uses Netty's default flow control. This is a 64 kb window, which with bytes acknowledged as soon they're received. We plan to add support for adjusting the default window size and flow control strategy in a future release.
109
+
7. If you were using `pipeline-transform` to alter the underlying Netty pipeline, you will need to check your usage of it for HTTP/2. Under the hood, the new HTTP/2 code uses Netty's multiplexed pipeline setup, with a shared connection-level pipeline that feeds stream-specific frames to N pipelines created for N individual streams. (A standard HTTP request/response pair maps to a single H2 stream.)
110
+
80
111
### WebSockets
81
112
82
113
On any HTTP request which has the proper `Upgrade` headers, you may call `(aleph.http/websocket-connection req)`, which returns a deferred which yields a **duplex stream**, which uses a single stream to represent bidirectional communication. Messages from the client can be received via `take!`, and sent to the client via `put!`. An echo WebSocket handler, then, would just consist of:
@@ -136,6 +167,6 @@ Minimal [`tools.deps`](https://github.com/clojure/tools.deps.alpha) support is a
0 commit comments