mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 08:31:28 +00:00
fix grpc dial ipv6 address (#476)
This commit is contained in:
parent
f65c21337c
commit
1d13a8da49
|
@ -90,8 +90,14 @@ func getGrpcClient(ctx context.Context, dest net.Destination, tlsConfig *tls.Con
|
||||||
dialOption = grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig.GetTLSConfig()))
|
dialOption = grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig.GetTLSConfig()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var grpcDestHost string
|
||||||
|
if dest.Address.Family().IsDomain() {
|
||||||
|
grpcDestHost = dest.Address.Domain()
|
||||||
|
} else {
|
||||||
|
grpcDestHost = dest.Address.IP().String()
|
||||||
|
}
|
||||||
conn, err := grpc.Dial(
|
conn, err := grpc.Dial(
|
||||||
gonet.JoinHostPort(dest.Address.String(), dest.Port.String()),
|
gonet.JoinHostPort(grpcDestHost, dest.Port.String()),
|
||||||
dialOption,
|
dialOption,
|
||||||
grpc.WithConnectParams(grpc.ConnectParams{
|
grpc.WithConnectParams(grpc.ConnectParams{
|
||||||
Backoff: backoff.Config{
|
Backoff: backoff.Config{
|
||||||
|
|
Loading…
Reference in a new issue