-
Notifications
You must be signed in to change notification settings - Fork 4k
DO NOT MERGE Use Cowboy's new direct data delivery for HTTP/2 Websocket #14500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Uses the latest Cowboy and Cowlib.
@@ -135,7 +135,7 @@ start_tls_listener(TLSConf0, CowboyOpts) -> | |||
num_acceptors => get_env(num_ssl_acceptors, 10), | |||
num_conns_sups => get_env(num_conns_sup, 1) | |||
}, | |||
case cowboy:start_tls(RanchRef, RanchTransportOpts, CowboyOpts) of | |||
case cowboy:start_tls(RanchRef, RanchTransportOpts, CowboyOpts#{enable_connect_protocol => true}) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This forces enable HTTP/2 Websocket. Not necessarily what we want. If enabled by default we want to be able to disable it.
%% We simulate PROXY headers when HTTP/2 is used to have src/dest. | ||
upgrade(Req=#{version := 'HTTP/2', peer := Peer, sock := Sock, cert := Cert}, | ||
Env, Handler, HandlerState, Opts) -> | ||
logger:error("~p ~p ~p ~p ~p", [Req, Env, Handler, HandlerState, Opts]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously remove this before we are done.
@@ -56,9 +56,25 @@ | |||
upgrade(Req, Env, Handler, HandlerState) -> | |||
upgrade(Req, Env, Handler, HandlerState, #{}). | |||
|
|||
%% We simulate PROXY headers when HTTP/2 is used to have src/dest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not true anymore.
Env, Handler, HandlerState, Opts) -> | ||
logger:error("~p ~p ~p ~p ~p", [Req, Env, Handler, HandlerState, Opts]), | ||
{SrcAddr, SrcPort} = Peer, | ||
{DestAddr, DestPort} = Sock, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps don't unwrap here, unwrap in rabbit_net functions.
dep_cowboy = hex 2.13.0 | ||
dep_cowlib = hex 2.14.0 | ||
dep_cowboy = git https://github.com/ninenines/cowboy direct-data_delivery-for-h2-websocket | ||
dep_cowlib = git https://github.com/ninenines/cowlib master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary.
Uses the latest Cowboy and Cowlib.