@@ -681,7 +681,6 @@ pub struct FileClusterFrontendConfig {
681681 #[ serde( default = "default_rule_position" ) ]
682682 pub position : RulePosition ,
683683 pub tags : Option < BTreeMap < String , String > > ,
684- pub h2 : Option < bool > ,
685684}
686685
687686impl FileClusterFrontendConfig {
@@ -767,7 +766,6 @@ impl FileClusterFrontendConfig {
767766 path,
768767 method : self . method . clone ( ) ,
769768 tags : self . tags . clone ( ) ,
770- h2 : self . h2 . unwrap_or ( false ) ,
771769 } )
772770 }
773771}
@@ -784,6 +782,7 @@ pub enum ListenerProtocol {
784782#[ serde( deny_unknown_fields, rename_all = "lowercase" ) ]
785783pub enum FileClusterProtocolConfig {
786784 Http ,
785+ Http2 ,
787786 Tcp ,
788787}
789788
@@ -873,7 +872,7 @@ impl FileClusterConfig {
873872 load_metric : self . load_metric ,
874873 } ) )
875874 }
876- FileClusterProtocolConfig :: Http => {
875+ FileClusterProtocolConfig :: Http | FileClusterProtocolConfig :: Http2 => {
877876 let mut frontends = Vec :: new ( ) ;
878877 for frontend in self . frontends {
879878 let http_frontend = frontend. to_http_front ( cluster_id) ?;
@@ -891,6 +890,7 @@ impl FileClusterConfig {
891890
892891 Ok ( ClusterConfig :: Http ( HttpClusterConfig {
893892 cluster_id : cluster_id. to_string ( ) ,
893+ http2 : self . protocol == FileClusterProtocolConfig :: Http2 ,
894894 frontends,
895895 backends : self . backends ,
896896 sticky_session : self . sticky_session . unwrap_or ( false ) ,
@@ -919,7 +919,6 @@ pub struct HttpFrontendConfig {
919919 #[ serde( default ) ]
920920 pub position : RulePosition ,
921921 pub tags : Option < BTreeMap < String , String > > ,
922- pub h2 : bool ,
923922}
924923
925924impl HttpFrontendConfig {
@@ -955,7 +954,6 @@ impl HttpFrontendConfig {
955954 path : self . path . clone ( ) ,
956955 method : self . method . clone ( ) ,
957956 position : self . position . into ( ) ,
958- h2 : self . h2 ,
959957 tags,
960958 } )
961959 . into ( ) ,
@@ -970,7 +968,6 @@ impl HttpFrontendConfig {
970968 path : self . path . clone ( ) ,
971969 method : self . method . clone ( ) ,
972970 position : self . position . into ( ) ,
973- h2 : self . h2 ,
974971 tags,
975972 } )
976973 . into ( ) ,
@@ -985,6 +982,7 @@ impl HttpFrontendConfig {
985982#[ serde( deny_unknown_fields) ]
986983pub struct HttpClusterConfig {
987984 pub cluster_id : String ,
985+ pub http2 : bool ,
988986 pub frontends : Vec < HttpFrontendConfig > ,
989987 pub backends : Vec < BackendConfig > ,
990988 pub sticky_session : bool ,
@@ -1000,6 +998,7 @@ impl HttpClusterConfig {
1000998 cluster_id: self . cluster_id. clone( ) ,
1001999 sticky_session: self . sticky_session,
10021000 https_redirect: self . https_redirect,
1001+ http2: self . http2,
10031002 proxy_protocol: None ,
10041003 load_balancing: self . load_balancing as i32 ,
10051004 answer_503: self . answer_503. clone( ) ,
@@ -1059,6 +1058,7 @@ impl TcpClusterConfig {
10591058 cluster_id: self . cluster_id. clone( ) ,
10601059 sticky_session: false ,
10611060 https_redirect: false ,
1061+ http2: false ,
10621062 proxy_protocol: self . proxy_protocol. map( |s| s as i32 ) ,
10631063 load_balancing: self . load_balancing as i32 ,
10641064 load_metric: self . load_metric. map( |s| s as i32 ) ,
0 commit comments