k6 icon indicating copy to clipboard operation
k6 copied to clipboard

grpc: Support HTTPS_PROXY

Open codebien opened this issue 2 years ago • 1 comments

Feature Description

The grpc-go project supports the HTTPS_PROXY variable for setting and enabling a proxy. Unfortunately, running a k6 test doesn't work as expected. It doesn't use the set proxy.

It is an expected behavior based on the current implementation. The grpc-go doesn't support the proxy if a custom dialer is set.

https://github.com/grpc/grpc-go/blob/11feb0a9afd844fd2ab1f18dca02ad6a344b21bf/internal/transport/http2_client.go#L155-L178

This affects the new experimental module and the stable k6/net/grpc based on the logic we have in the netext/grpc package:

https://github.com/grafana/k6/blob/a2fe0a8e824423262e7029c3853dc0fa5ce9f9b6/lib/netext/grpcext/conn.go#L59-L61

Expected behavior

HTTPS_PROXY=mygrpcentrypoint:9000 k6 run script.js

Note: HTTP_PROXY is not expected to work because it is not supported by the grpc-go library.

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

The original forum discussion https://community.k6.io/t/grpc-proxy-not-working/7347

codebien avatar Jul 06 '23 15:07 codebien

/assign ✋🏻

Azhovan avatar Dec 29 '23 22:12 Azhovan