使用nodejs或java中的grpc,使grpc客户端通过代理连接到服务器所需的属性或配置是什么?
我无法找到解释设置的示例或文档 . 我是否需要在代码中做一些事情?
我在代理后面,我不确定问题是我的设置不正确还是我的代理不支持grpc . 它支持http / 2作为协议升级 .
我在java中的代理设置是:
-Dhttp.proxyHost=xxx.xxx.xxx
-Dhttp.proxyPort=8888
-Dhttp.nonProxyHosts="*.nowhere.nothing"
-Dhttps.proxyHost=xxx.xxx.com
-Dhttps.proxyPort=8888
-Dhttps.nonProxyHosts="*.nowhere.nothing"
-Dsocks.proxyHost=xxx.xxx.xxx
-Dsocks.proxyPort=8888
-Dsocks.nonProxyHosts="*.nowhere.nothing"
1 回答
从grpc-java 1.0.3开始,您可以使用
host:port
形式的值指定环境变量GRPC_PROXY_EXP
. "EXP"表示实验,因为在grpc-java观察到正常的Java设置(如https.proxyHost
)之后它将被删除 .