NewClientConnection creates a new client connection for the given reader and writer
(reader io.Reader, writer io.Writer)
| 11 | |
| 12 | // NewClientConnection creates a new client connection for the given reader and writer |
| 13 | func NewClientConnection(reader io.Reader, writer io.Writer) (*grpc.ClientConn, error) { |
| 14 | pipe := NewStdStreamJoint(reader, writer, false) |
| 15 | |
| 16 | // Set up a connection to the server. |
| 17 | return grpc.NewClient("passthrough:///", |
| 18 | grpc.WithTransportCredentials(insecure.NewCredentials()), |
| 19 | grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { |
| 20 | return pipe, nil |
| 21 | }), |
| 22 | grpc.WithLocalDNSResolution()) |
| 23 | } |