Skip to content

Commit

Permalink
fix: grpc server's ALPN order
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Feb 27, 2025
1 parent 1dc4155 commit 3b40bf7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion listener/sing_vless/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func New(config LC.VlessServer, tunnel C.Tunnel, additions ...inbound.Addition)
},
HttpHandler: httpHandler,
})
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "h2")
tlsConfig.NextProtos = append([]string{"h2"}, tlsConfig.NextProtos...) // h2 must before http/1.1
}

for _, addr := range strings.Split(config.Listen, ",") {
Expand Down
2 changes: 1 addition & 1 deletion listener/sing_vmess/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func New(config LC.VmessServer, tunnel C.Tunnel, additions ...inbound.Addition)
},
HttpHandler: httpHandler,
})
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "h2")
tlsConfig.NextProtos = append([]string{"h2"}, tlsConfig.NextProtos...) // h2 must before http/1.1
}

for _, addr := range strings.Split(config.Listen, ",") {
Expand Down
2 changes: 1 addition & 1 deletion listener/trojan/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func New(config LC.TrojanServer, tunnel C.Tunnel, additions ...inbound.Addition)
},
HttpHandler: httpHandler,
})
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "h2")
tlsConfig.NextProtos = append([]string{"h2"}, tlsConfig.NextProtos...) // h2 must before http/1.1
}

for _, addr := range strings.Split(config.Listen, ",") {
Expand Down

0 comments on commit 3b40bf7

Please # to comment.