質問

I have a derived class of WebClient that overrides WebRequest to return a request object with the certificate needed to talk to our ElasticSearch cluster via proxy. How do I use this with Nest? Thanks.

役に立ちましたか?

解決

You can subclass Connection

https://github.com/Mpdreamz/NEST/blob/master/src/Nest/Domain/Connection/Connection.cs

And override

protected override HttpWebRequest CreateWebRequest(string path, string method)
{
       //return your derived WebRequest here.
}

then use this overload on ElasticClient

https://github.com/Mpdreamz/NEST/blob/master/src/Nest/ElasticClient.cs#L29

To use your custom IConnection.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top