Bug 25306 - Installing Xamarin Andorid Player behind proxy
Summary: Installing Xamarin Andorid Player behind proxy
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Android Player
Classification: Xamarin
Component: Player ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-11 17:55 UTC by Kerry Jenkins
Modified: 2015-01-15 09:41 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Kerry Jenkins 2014-12-11 17:55:01 UTC
I experienced multiple problems getting Android Player installed due to our Internet proxy and the fact that zip files are downloaded and virus scanned on the network before being given to the client application that is requesting it.  

I have been able to work around these problems but my management has asked me to ask if Xamarin has a better way to accomplish this.  I sent a support request and they told me there is not a better way and that I should post my experience here.

Here are the steps that I executed to get Android Player installed.  Hopefully you can see ways to improve the install process by seeing what I had to do.

When I initially attempted the install I was getting an error.  The log file showed:
Unable to download manifest: System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.  So I added AndroidPlayer.exe.config and DeviceManager.exe.config files to the c:\Program Files\Xamarin Android Player folder and by trial and error found a combination of settings that worked with our proxy:

<?xml version="1.0"?>
<configuration>
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy scriptLocation="<url for our proxy pac>" />
<bypasslist />
</defaultProxy>
</system.net>
</configuration>

This allowed me to get the point where I could download the devices but when I went to download the device I was getting an error. Looking at the log in c:\ProgramData\XamarinAndroidPlayer I could see that it was timing out trying to download a zip file:
Web request created: http://xamarin-android-player.s3.amazonaws.com/device-packages/nexus_4_16.zip
Exception while trying to download image: System.Net.WebException: The request was aborted: The operation has timed out.

I copied the url into a web browser and attempted the download. I saw that our network was downloading the file and doing a virus scan on it. I think that is why the XamarinAndroidPlayer was timing out. I downloaded the zips for the nexus_4_16 and nexus_4_19 manually. I did the install on a machine outside of our corporate network and saw that it worked properly and also saw in the log file that it ran a number of steps after the download. I thought about trying to do it all manual but that made me nervous. I decided to change my hosts file (c:\windows\system32\drivers\etc\hosts) to spoof the host url that you were using for the zips to point to my machine and set up the downloaded zip and manifest files on the web server on my machine so the install would download them from my machine and bypass the network virus scan. I did this and it was successful.

As in most organizations we have "network Nazis" that control the network access. Their response to this problem is that Xamarin is "doing it wrong". Of course I would expect you to say that our "network Nazis" are doing it wrong. I am just a developer trying to get stuff done. I wish there was a better way.

Thanks,
Kerry
Comment 1 Will Schaller 2014-12-16 12:20:47 UTC
Great bug report, thanks Kerry. It definitely shouldn't be this difficult to use XAP with a proxy, we'll look into supporting proxies for our next update.
Comment 2 Sriram 2014-12-31 05:38:47 UTC
Hello,

I am also facing the same problem and unfortunately the XML given for config files is not working for me. Is there a quick solution or workaround at this time?
Comment 3 Will Schaller 2015-01-15 08:41:46 UTC
Update 0.2.5 has support for proxies using DefaultNetworkCredentials, so hopefully this issue should be fixed. Please let me know if you still have this problem using the new version.
Comment 4 Kerry Jenkins 2015-01-15 09:41:04 UTC
I tested the new version and it fixes the proxy problem.  Thank you.

I am still having a problem downloading devices.  The log file at C:\ProgramData\XamarinAndroidPlayer\DeviceManager20150115134905.log says:

Download! Nexus 7 (Jelly Bean) / API 16
Looking up existing machine type Nexus 7 api level 16 in manifest...
Attempting to download nexus_7_16.zip
Starting download...
Web request created: http://xamarin-android-player.s3.amazonaws.com/device-packages/nexus_7_16.zip
Error : Error downloading image, please check your network connection.
Xamarin.AndroidPlayer.API.XAPSystemIOException: Error downloading image, please check your network connection. ---> System.Net.WebException: The request was aborted: The operation has timed out.
   at System.Net.HttpWebRequest.GetResponse()
   at Xamarin.AndroidPlayer.API.XAPSystemIO.DownloadImageZip(DownloadableImageJSON image)
   --- End of inner exception stack trace ---
   at Xamarin.AndroidPlayer.API.XAPSystemIO.DownloadImageZip(DownloadableImageJSON image)
   at DeviceManager.MainWindow.<>c__DisplayClass29.<OnDownloadClick>b__28()


The problem is that our network is set up to download and virus scan ZIP files before they are given to the requesting application.  If I put the address of the ZIP file in a browser here is a link to what I see:

https://www.dropbox.com/s/zrt4m71pil4m5tx/Photo%20Jan%2015%2C%208%2036%2013%20AM.png?dl=0

I wish I had the option to download the zip files manually and have the Xamarin Android Device Player use the manually downloaded zip file to install a new device.

Thanks,
Kerry