I'm trying to pass my elasticsearch calls from NEST through Fiddler so I can see actual json requests and responses.
I've done the following to create my client, but the requests are not being pushed through the proxy (it doesn't matter if Fiddler is on or off, request still gets to elasticsearch).
ConnectionSettings cs = new ConnectionSettings(uri);
cs.SetProxy(new Uri("http://localhost:8888"),"username", "password");
elasticClient = new ElasticClient(cs);
Fiddler has no username/password requirements so I just pass random text.
I can confirm that at the point just before executing request my elasticClient has the proxy property filled in with Uri specified above, though with a trailing slash added by NEST.
Thanks
Okay, so, I gave up on the NEST proxy settings - they didn't seem to make any difference.
However, setting host on the NEST client to "http://ipv4.fiddler:9200" instead of localhost routes the call through Fiddler and achieved the desired result of allowing me to see both requests and responses from Elasticsearch.
If you want to see the requests a that .net application makes in fiddler you can specify the proxy in the web/app.config
As documented on fiddler's website
http://docs.telerik.com/fiddler/configure-fiddler/tasks/configuredotnetapp
<system.net>
<defaultProxy>
<proxy
autoDetect="false"
bypassonlocal="false"
proxyaddress="http://127.0.0.1:8888"
usesystemdefault="false" />
</defaultProxy>
</system.net>
Handy if changing the hostname to ipv4.fiddler
is not an option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With