Skip to content

Commit 4af7faf

Browse files
committed
Use Cowboy's new direct data delivery for HTTP/2 Websocket
Uses the latest Cowboy and Cowlib.
1 parent 76aa1e6 commit 4af7faf

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

deps/rabbitmq_web_mqtt/src/rabbit_web_mqtt_handler.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ init(Req, Opts) ->
8484
stats_timer = rabbit_event:init_stats_timer()},
8585
WsOpts0 = proplists:get_value(ws_opts, Opts, #{}),
8686
WsOpts = maps:merge(#{compress => true}, WsOpts0),
87-
{?MODULE, Req1, State, WsOpts}
87+
{?MODULE, Req1, State, WsOpts#{data_delivery => relay}}
8888
end
8989
end.
9090

deps/rabbitmq_web_stomp/src/rabbit_web_stomp_handler.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ init(Req0, Opts) ->
9595
socket = SockInfo,
9696
peername = PeerAddr,
9797
auth_hd = cowboy_req:header(<<"authorization">>, Req)
98-
}, WsOpts}.
98+
}, WsOpts#{data_delivery => relay}}.
9999

100100
websocket_init(State) ->
101101
process_flag(trap_exit, true),

rabbitmq-components.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ endif
4040
# all projects use the same versions. It avoids conflicts.
4141

4242
dep_accept = hex 0.3.5
43-
dep_cowboy = hex 2.13.0
44-
dep_cowlib = hex 2.14.0
43+
dep_cowboy = git https://github.com/ninenines/cowboy direct-data_delivery-for-h2-websocket
44+
dep_cowlib = git https://github.com/ninenines/cowlib master
4545
dep_credentials_obfuscation = hex 3.5.0
4646
dep_cuttlefish = hex 3.5.0
4747
dep_gen_batch_server = hex 0.8.8

0 commit comments

Comments
 (0)