Add REALITY support to gRPC client and server

Now you are able to configure REALITY gRPC client and server
Duplicate of REALITY H2, perhaps, just for fun
This commit is contained in:
RPRX 2023-02-27 19:52:01 +00:00 committed by GitHub
parent 9401d65ef1
commit 55dc26f228
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 6 deletions

View file

@ -849,8 +849,8 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
config.SecurityType = tm.Type
}
if strings.EqualFold(c.Security, "reality") {
if config.ProtocolName != "tcp" && config.ProtocolName != "http" && config.ProtocolName != "domainsocket" {
return nil, newError("REALITY only supports TCP, H2 and DomainSocket for now.")
if config.ProtocolName != "tcp" && config.ProtocolName != "http" && config.ProtocolName != "grpc" && config.ProtocolName != "domainsocket" {
return nil, newError("REALITY only supports TCP, H2, gRPC and DomainSocket for now.")
}
if c.REALITYSettings == nil {
return nil, newError(`REALITY: Empty "realitySettings".`)