最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

具有正向代理的从客户端到服务器的GRPC

IT培训 admin 6浏览 0评论

具有正向代理的从客户端到服务器的GRPC

使用来自nodejs或java的grpc,使grpc客户端通过代理连接到服务器需要什么属性或配置?

我无法找到示例或说明设置的文档。我需要在代码本身中做些什么吗?

我在代理后面,我不确定问题是我的设置不正确还是我的代理不支持grpc。它支持http / 2作为协议升级。

我在Java中的代理设置是:

-Dhttp.proxyHost=xxx.xxx.xxx
-Dhttp.proxyPort=8888 
-Dhttp.nonProxyHosts="*.nowhere.nothing"
-Dhttps.proxyHost=xxx.xxx
-Dhttps.proxyPort=8888
-Dhttps.nonProxyHosts="*.nowhere.nothing"
-Dsocks.proxyHost=xxx.xxx.xxx
-Dsocks.proxyPort=8888
-Dsocks.nonProxyHosts="*.nowhere.nothing"
回答如下:

自grpc-java 1.0.3起,您可以使用GRPC_PROXY_EXP形式的值指定环境变量host:port。 “ EXP”表示实验性的,因为它将在grpc-java观察到正常的Java设置(例如https.proxyHost)后将其删除。

具有正向代理的从客户端到服务器的GRPC

使用来自nodejs或java的grpc,使grpc客户端通过代理连接到服务器需要什么属性或配置?

我无法找到示例或说明设置的文档。我需要在代码本身中做些什么吗?

我在代理后面,我不确定问题是我的设置不正确还是我的代理不支持grpc。它支持http / 2作为协议升级。

我在Java中的代理设置是:

-Dhttp.proxyHost=xxx.xxx.xxx
-Dhttp.proxyPort=8888 
-Dhttp.nonProxyHosts="*.nowhere.nothing"
-Dhttps.proxyHost=xxx.xxx
-Dhttps.proxyPort=8888
-Dhttps.nonProxyHosts="*.nowhere.nothing"
-Dsocks.proxyHost=xxx.xxx.xxx
-Dsocks.proxyPort=8888
-Dsocks.nonProxyHosts="*.nowhere.nothing"
回答如下:

自grpc-java 1.0.3起,您可以使用GRPC_PROXY_EXP形式的值指定环境变量host:port。 “ EXP”表示实验性的,因为它将在grpc-java观察到正常的Java设置(例如https.proxyHost)后将其删除。

发布评论

评论列表 (0)

  1. 暂无评论