문제

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