Closed chester89 closed 8 years ago
I think NginxProxyRequestBuilder
isn't needed in the library, I'll remove it
Ok, ready for your review @bcuff
The weird changeset for the project file is due to inconsistent line endings, I guess
Thanks for the PR. Hmm... is it really necessary to pull so much of the client into the abstraction? The client doesn't do much anymore. I would think that something like the following would be sufficient and would only require a very small change.
public interface IGeocodeProxyProvider
{
// If a proxy was specified to the client it would call this to
// this in DoWebRequest instead of WebRequest.CreateHttp(url);
HttpWebRequest CreateRequest(string url);
}
Then a proxy implementation might look something like this
public class MyGeocodeProxy : IGeocodeProxyProvider
{
public HttpWebRequest CreateRequest(string url)
{
url = new UriBuilder(url)
{
Host = "geocodeproxy.mydomain.com",
Port = 8080
}.Uri.ToString();
return WebRequest.CreateHttp(url);
}
}
Would this give you the power you need? Maybe I missed something?
Well, that should work, and it's definitely much simpler design than mine. I guess, in your case, the logic of url building (adding parameters, mostly) will remain in the GeocodeClient class?
2016-08-12 16:51 GMT+03:00 Brandon notifications@github.com:
Thanks for the PR. Hmm... is it really necessary to pull so much of the client into the abstraction? The client doesn't do much anymore. I would think that something like the following would be sufficient and would only require a very small change.
public interface IGeocodeProxyProvider { // If a proxy was specified to the client it would call this to // this in DoWebRequest instead of WebRequest.CreateHttp(url); HttpWebRequest CreateRequest(string url); }
Then a proxy implementation might look something like this
public class MyGeocodeProxy : IGeocodeProxyProvider { public HttpWebRequest CreateRequest(string url) { url = new UriBuilder(url) { Host = "geocodeproxy.mydomain.com", Port = 8080 }.Uri.ToString(); return WebRequest.CreateHttp(url); } }
Would this give you the power you need? Maybe I missed something?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bcuff/GeocodeSharp/pull/14#issuecomment-239451559, or mute the thread https://github.com/notifications/unsubscribe-auth/AALnfOGuAjfRqzmgf_0mxTJ8t08MgdDWks5qfHpkgaJpZM4JiNgY .
Yours faithfully, Gleb
Yes. You would just get the opportunity to make adjustments to the request before it was sent.
Closed in favor of #15
To cover #13