diff --git a/include/types/connection.h b/include/types/connection.h index cf5dbb6b7..46d74fecf 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -429,9 +429,17 @@ enum alpn_proxy_mode { ALPN_MODE_ANY = ALPN_MODE_TCP | ALPN_MODE_HTTP, }; +enum alpn_proxy_side { + ALPN_SIDE_NONE = 0, + ALPN_SIDE_FE = 1, // same as PR_CAP_FE + ALPN_SIDE_BE = 2, // same as PR_CAP_BE + ALPN_SIDE_BOTH = ALPN_SIDE_FE | ALPN_SIDE_BE, +}; + struct alpn_mux_list { const struct ist token; /* token name and length. Empty is catch-all */ enum alpn_proxy_mode mode; + enum alpn_proxy_side side; const struct mux_ops *mux; struct list list; }; diff --git a/src/mux_h2.c b/src/mux_h2.c index f46504cab..192578bba 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3603,7 +3603,7 @@ const struct mux_ops h2_ops = { /* ALPN selection : this mux registers ALPN tolen "h2" */ static struct alpn_mux_list alpn_mux_h2 = - { .token = IST("h2"), .mode = ALPN_MODE_HTTP, .mux = &h2_ops }; + { .token = IST("h2"), .mode = ALPN_MODE_HTTP, .side = ALPN_SIDE_FE, .mux = &h2_ops }; /* config keyword parsers */ static struct cfg_kw_list cfg_kws = {ILH, { diff --git a/src/mux_pt.c b/src/mux_pt.c index d6c1f83ab..131b07083 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -217,7 +217,7 @@ const struct mux_ops mux_pt_ops = { /* ALPN selection : default mux has empty name */ static struct alpn_mux_list alpn_mux_pt = - { .token = IST(""), .mode = ALPN_MODE_ANY, .mux = &mux_pt_ops }; + { .token = IST(""), .mode = ALPN_MODE_ANY, .side = ALPN_SIDE_BOTH, .mux = &mux_pt_ops }; __attribute__((constructor)) static void __mux_pt_init(void)