@@ -681,7 +681,6 @@ pub struct FileClusterFrontendConfig {
681
681
#[ serde( default = "default_rule_position" ) ]
682
682
pub position : RulePosition ,
683
683
pub tags : Option < BTreeMap < String , String > > ,
684
- pub h2 : Option < bool > ,
685
684
}
686
685
687
686
impl FileClusterFrontendConfig {
@@ -767,7 +766,6 @@ impl FileClusterFrontendConfig {
767
766
path,
768
767
method : self . method . clone ( ) ,
769
768
tags : self . tags . clone ( ) ,
770
- h2 : self . h2 . unwrap_or ( false ) ,
771
769
} )
772
770
}
773
771
}
@@ -784,6 +782,7 @@ pub enum ListenerProtocol {
784
782
#[ serde( deny_unknown_fields, rename_all = "lowercase" ) ]
785
783
pub enum FileClusterProtocolConfig {
786
784
Http ,
785
+ Http2 ,
787
786
Tcp ,
788
787
}
789
788
@@ -873,7 +872,7 @@ impl FileClusterConfig {
873
872
load_metric : self . load_metric ,
874
873
} ) )
875
874
}
876
- FileClusterProtocolConfig :: Http => {
875
+ FileClusterProtocolConfig :: Http | FileClusterProtocolConfig :: Http2 => {
877
876
let mut frontends = Vec :: new ( ) ;
878
877
for frontend in self . frontends {
879
878
let http_frontend = frontend. to_http_front ( cluster_id) ?;
@@ -891,6 +890,7 @@ impl FileClusterConfig {
891
890
892
891
Ok ( ClusterConfig :: Http ( HttpClusterConfig {
893
892
cluster_id : cluster_id. to_string ( ) ,
893
+ http2 : self . protocol == FileClusterProtocolConfig :: Http2 ,
894
894
frontends,
895
895
backends : self . backends ,
896
896
sticky_session : self . sticky_session . unwrap_or ( false ) ,
@@ -919,7 +919,6 @@ pub struct HttpFrontendConfig {
919
919
#[ serde( default ) ]
920
920
pub position : RulePosition ,
921
921
pub tags : Option < BTreeMap < String , String > > ,
922
- pub h2 : bool ,
923
922
}
924
923
925
924
impl HttpFrontendConfig {
@@ -955,7 +954,6 @@ impl HttpFrontendConfig {
955
954
path : self . path . clone ( ) ,
956
955
method : self . method . clone ( ) ,
957
956
position : self . position . into ( ) ,
958
- h2 : self . h2 ,
959
957
tags,
960
958
} )
961
959
. into ( ) ,
@@ -970,7 +968,6 @@ impl HttpFrontendConfig {
970
968
path : self . path . clone ( ) ,
971
969
method : self . method . clone ( ) ,
972
970
position : self . position . into ( ) ,
973
- h2 : self . h2 ,
974
971
tags,
975
972
} )
976
973
. into ( ) ,
@@ -985,6 +982,7 @@ impl HttpFrontendConfig {
985
982
#[ serde( deny_unknown_fields) ]
986
983
pub struct HttpClusterConfig {
987
984
pub cluster_id : String ,
985
+ pub http2 : bool ,
988
986
pub frontends : Vec < HttpFrontendConfig > ,
989
987
pub backends : Vec < BackendConfig > ,
990
988
pub sticky_session : bool ,
@@ -1000,6 +998,7 @@ impl HttpClusterConfig {
1000
998
cluster_id: self . cluster_id. clone( ) ,
1001
999
sticky_session: self . sticky_session,
1002
1000
https_redirect: self . https_redirect,
1001
+ http2: self . http2,
1003
1002
proxy_protocol: None ,
1004
1003
load_balancing: self . load_balancing as i32 ,
1005
1004
answer_503: self . answer_503. clone( ) ,
@@ -1059,6 +1058,7 @@ impl TcpClusterConfig {
1059
1058
cluster_id: self . cluster_id. clone( ) ,
1060
1059
sticky_session: false ,
1061
1060
https_redirect: false ,
1061
+ http2: false ,
1062
1062
proxy_protocol: self . proxy_protocol. map( |s| s as i32 ) ,
1063
1063
load_balancing: self . load_balancing as i32 ,
1064
1064
load_metric: self . load_metric. map( |s| s as i32 ) ,
0 commit comments