|
|
@@ -11,6 +11,7 @@ import (
|
|
|
"github.com/xtls/xray-core/common/session"
|
|
|
"github.com/xtls/xray-core/transport/internet"
|
|
|
"github.com/xtls/xray-core/transport/internet/grpc/encoding"
|
|
|
+ "github.com/xtls/xray-core/transport/internet/reality"
|
|
|
"github.com/xtls/xray-core/transport/internet/stat"
|
|
|
"github.com/xtls/xray-core/transport/internet/tls"
|
|
|
"google.golang.org/grpc"
|
|
|
@@ -77,6 +78,7 @@ func getGrpcClient(ctx context.Context, dest net.Destination, streamSettings *in
|
|
|
globalDialerMap = make(map[dialerConf]*grpc.ClientConn)
|
|
|
}
|
|
|
tlsConfig := tls.ConfigFromStreamSettings(streamSettings)
|
|
|
+ realityConfig := reality.ConfigFromStreamSettings(streamSettings)
|
|
|
sockopt := streamSettings.SocketSettings
|
|
|
grpcSettings := streamSettings.ProtocolSettings.(*Config)
|
|
|
|
|
|
@@ -116,7 +118,11 @@ func getGrpcClient(ctx context.Context, dest net.Destination, streamSettings *in
|
|
|
return nil, err
|
|
|
}
|
|
|
address := net.ParseAddress(rawHost)
|
|
|
- return internet.DialSystem(gctx, net.TCPDestination(address, port), sockopt)
|
|
|
+ c, err := internet.DialSystem(gctx, net.TCPDestination(address, port), sockopt)
|
|
|
+ if err == nil && realityConfig != nil {
|
|
|
+ return reality.UClient(c, realityConfig, ctx, dest)
|
|
|
+ }
|
|
|
+ return c, err
|
|
|
}),
|
|
|
}
|
|
|
|