-
Notifications
You must be signed in to change notification settings - Fork 33
Proxy property is not working on iOS devices #57
Comments
Thank you, I'll take a look at this problem. Sadly, the main reason why I added the Proxy property access using reflection, was, that the property should be available according to the PCL contract, but it was missing when used on a Xamarin supported platform. I'll take a look if this workaround can be removed now. |
Not at all, man. I could not set Proxy property of HttpClientHandler in my implementation directly. Only the solution contains reflection works good for me. While I was trying to set Proxy directly I caught an exception which said that there was no setter for property Proxy. I guess it might be happened only for iOS platform. So I decided to set private field "proxy" by reflection. Maybe below code will help you.
|
Fixed in 3.1.1 |
The problem still exists. |
Please try 3.1.2. It's difficult for me to test, because I don't have an iOS device/emulator ATM |
I have tested 3.1.2 and the problem still exists. Please see my thoughts here |
…it should fix the problem according to zevsst. We now use the USE_TYPEINFO variant for iOS.
I am still seeing this in 3.3.0 using the latest version of Xamarin at the time of writing. I am currently testing iOS and getting proxy is missing. I am attempting to integrate a
Using: Xamarin.Android protected override HttpMessageHandler CreateMessageHandler(IRestClient client, IRestRequest request)
{
var proxy = GetProxy(client);
var cookies = GetCookies(client, request);
var credentials = client.Credentials;
var httpClientHandler = new NativeMessageHandler();
if (httpClientHandler.SupportsProxy && proxy != null)
{
httpClientHandler.UseProxy = true;
httpClientHandler.Proxy = new RequestProxyWrapper(proxy);
}
if (cookies != null)
{
httpClientHandler.UseCookies = true;
httpClientHandler.CookieContainer = cookies;
}
if (credentials != null)
{
httpClientHandler.Credentials = credentials;
}
return httpClientHandler;
} |
Hello.
Please have a look at the bug description and one of the possible solutions in the comment section.
http://stackoverflow.com/questions/24340570/restsharp-portable-restclient-proxy-property-is-not-working/36165221#36165221
Thanks.
The text was updated successfully, but these errors were encountered: