Skip to content

Conversation

lhoguin
Copy link
Contributor

@lhoguin lhoguin commented Sep 3, 2025

Uses the latest Cowboy and Cowlib.

@mergify mergify bot added the make label Sep 3, 2025
@@ -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
Copy link
Contributor Author

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]),
Copy link
Contributor Author

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.
Copy link
Contributor Author

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,
Copy link
Contributor Author

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant