@@ -13,7 +13,8 @@ Hackney supports HTTP/2 with automatic protocol negotiation via ALPN (Applicatio
1313- ** Multiplexing** - Multiple requests share a single connection
1414- ** Header compression** - HPACK compression reduces overhead
1515- ** Flow control** - Automatic window management
16- - ** Server push** - Optional support for server-initiated streams
16+ - ** Delegated to ` erlang_h2 ` ** - the underlying HTTP/2 stack is the ` h2 `
17+ hex package; hackney exposes the same request API it always did
1718
1819## Quick Start
1920
@@ -243,20 +244,10 @@ end) || Path <- Paths].
243244
244245## Server Push
245246
246- Server push allows the server to send resources before the client requests them. By default, hackney rejects server pushes. To handle them:
247-
248- ``` erlang
249- % % Using low-level API with push handler
250- {ok , Conn } = hackney_conn :start_link (#{
251- host => " example.com" ,
252- port => 443 ,
253- transport => hackney_ssl ,
254- enable_push => self () % % Receive push notifications
255- }),
256-
257- % % Push notifications arrive as messages:
258- % % {hackney_push, ConnPid, {PromisedStreamId, Method, Scheme, Authority, Path, Headers}}
259- ```
247+ Server push (RFC 7540 §8.2) is deprecated and no longer supported by the
248+ underlying ` h2 ` library. The ` enable_push ` option is accepted for
249+ backwards-compatibility but is a no-op; pushes from the server are silently
250+ refused.
260251
261252## Flow Control
262253
@@ -275,11 +266,14 @@ HTTP/2 specific errors:
275266case hackney :get (URL ) of
276267 {ok , Status , Headers , Body } ->
277268 ok ;
278- {error , {h2_connection_error , ErrorCode }} ->
279- % % HTTP/2 connection-level error
280- io :format (" HTTP/2 error: ~p~n " , [ErrorCode ]);
281- {error , closed } ->
282- % % Connection closed (GOAWAY received)
269+ {error , {goaway , ErrorCode }} ->
270+ % % Peer sent GOAWAY
271+ io :format (" HTTP/2 GOAWAY: ~p~n " , [ErrorCode ]);
272+ {error , {stream_error , ErrorCode }} ->
273+ % % Peer sent RST_STREAM for this request
274+ io :format (" HTTP/2 stream reset: ~p~n " , [ErrorCode ]);
275+ {error , {closed , _Reason }} ->
276+ % % Connection closed
283277 ok ;
284278 {error , Reason } ->
285279 io :format (" Error: ~p~n " , [Reason ])
0 commit comments