-
Hello, We use connect-go almost successfully to multiplex gRPC/gRPC-Web/Connect protocols. apiVersion: v1
kind: Service
metadata:
name: foo
namespace: bar
spec:
selector:
app: foo
ports:
- name: grpc-h2c
port: 8080
targetPort: connect
protocol: TCP
appProtocol: grpc The client is on the same Kubernetes cluster and connecting the service with gRPC. client := foo.NewFooClient(httpClient, "http://foo.bar.svc:8080",
connect.WithGRPC(),
) We only got Does anyone have any information? |
Beta Was this translation helpful? Give feedback.
Answered by
ymmt2005
Oct 30, 2023
Replies: 1 comment 4 replies
-
We found the cause. As in the doc, we should've created it as: func newInsecureClient() *http.Client {
return &http.Client{
Transport: &http2.Transport{
AllowHTTP: true,
DialTLS: func(network, addr string, _ *tls.Config) (net.Conn, error) {
// If you're also using this client for non-h2c traffic, you may want
// to delegate to tls.Dial if the network isn't TCP or the addr isn't
// in an allowlist.
return net.Dial(network, addr)
},
// Don't forget timeouts!
},
}
} |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
akshayjshah
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We found the cause.
It was because we didn't create the
httpClient
as instructed.As in the doc, we should've created it as:
https://connectrpc.com/docs/go/deployment#h2c