sexta-feira, 17 de julho de 2015

Android Player - Xamarin Proxy

1) Create your own Assembly Proxy

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Configuration;

namespace ProxyUtil
    public class MyProxy : IWebProxy
      public ICredentials Credentials
          return new NetworkCredential(ConfigurationManager.AppSettings["NetworkUserName"],
        set { }

      public Uri GetProxy(Uri destination)
        return new Uri(ConfigurationManager.AppSettings["HttpProxyPort"]);

      public bool IsBypassed(Uri host)
        return false;


Copy the Assembly to Directory
 C:\Program Files\Xamarin Android Player\

2) Setup the Variables on the file DeviceManager.exe.config and the AndroidPlayer.exe.config

The context bellow must be on DeviceManager.exe.config and 

xml version="1.0" encoding="utf-8" ?>
    <add key="HttpProxyPort" value="http://YOURPROXY:PORT"/>
    <add key="NetworkUserName" value="USERNAME"/>
    <add key="NetworkUserPass" value="PASSWORD"/>
    <defaultProxy enabled="true" useDefaultCredentials="false">
      <module type="ProxyUtil.MyProxy, ProxyUtil"/>
      <servicePointManager expect100Continue="false" />

 3) Check the logs on C:\ProgramData\XamarinAndroidPlayer

Postar um comentário