如何在 C# Neo4jClient 中使用代理?
How to use a proxy with the C# Neo4jClient?
一个路由 Neo4jClient 如何通过代理连接?
客户端在 GraphClient
构造函数中接受 IHttpClient
,但它是不公开任何代理属性的内部类型
下面的代码从 1.1.0.32 开始工作,其中 proxyUri
类似于 http://myproxy.net:8080
var graphUri = new Uri(ConnectionConfig.GraphUri);
var httpClientHandler = new HttpClientHandler();
httpClientHandler.Proxy = new WebProxy(ConnectionConfig.ProxyUri, true);
httpClientHandler.UseProxy = true;
var httpClient = new HttpClient(httpClientHandler);
var httpClientWrapper = new HttpClientWrapper(ConnectionConfig.Username, ConnectionConfig.Password, httpClient);
_graphClient = new GraphClient(graphUri, httpClientWrapper);
一个路由 Neo4jClient 如何通过代理连接?
客户端在 GraphClient
构造函数中接受 IHttpClient
,但它是不公开任何代理属性的内部类型
下面的代码从 1.1.0.32 开始工作,其中 proxyUri
类似于 http://myproxy.net:8080
var graphUri = new Uri(ConnectionConfig.GraphUri);
var httpClientHandler = new HttpClientHandler();
httpClientHandler.Proxy = new WebProxy(ConnectionConfig.ProxyUri, true);
httpClientHandler.UseProxy = true;
var httpClient = new HttpClient(httpClientHandler);
var httpClientWrapper = new HttpClientWrapper(ConnectionConfig.Username, ConnectionConfig.Password, httpClient);
_graphClient = new GraphClient(graphUri, httpClientWrapper);