-
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.
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.
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