Skip to content

Commit

Permalink
Change grpc client to dial 127.0.0.1 rather than [::]
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-dydx committed Jan 11, 2024
1 parent bdf96fd commit 7639381
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,16 @@ func startInProcess(parentCtx context.Context, ctx *Context, clientCtx client.Co
maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize
}

grpcSrvAddrString := fmt.Sprintf("%s://%s", grpcSrvAddr.Network(), grpcSrvAddr.String())
var grpcSrvAddrString string
if grpcSrvAddr.Network() == "tcp" {
_, port, err := net.SplitHostPort(grpcSrvAddr.String())
if err != nil {
return err
}
grpcSrvAddrString = fmt.Sprintf("127.0.0.1:%s", port)
} else {
grpcSrvAddrString = fmt.Sprintf("%s://%s", grpcSrvAddr.Network(), grpcSrvAddr.String())
}
// If grpc is enabled, configure grpc client for grpc gateway.
grpcClient, err := grpc.Dial(
grpcSrvAddrString,
Expand Down

0 comments on commit 7639381

Please sign in to comment.