3

I am using android studio in a network using proxy. Since I need to set the proxy in order to get gradle to work, i was doing some research. I know that adding to Gradle properties the following code should actually work:

systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=443
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.auth.ntlm.domain=domain

systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=443
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.auth.ntlm.domain=domain

I have a pac file gain access, but am not able to fill in the proxy port for example. Is there any way to set proxy through the pac file? Thanks a lot in advance!

E.Schaller
  • 33
  • 2
  • 5
  • Download the pac file using your browser, and open it in a text editor. It should contain all the details you'll need to fill in the systemProps. – RaGe Apr 18 '16 at 13:56
  • 1
    To expand on RaGe's comment, you can get the proxy host name and port number as follows: Goto CHROME Settings>advanced>System>Open proxy settings>Connections Tab>LAN Settings. The auto-detect URL looks something like this: something.something.company.com/pac.pac Put this URL in your browser address bar and view the resulting PAC (i.e. text) file (for example using notepad) The Proxy listed in that text file is something like this: something.something.org The port is an integer, such as 80 or 8080. I did not need the other information such as username,password or domain for this to work. – J.E.Tkaczyk Jun 28 '18 at 20:52

1 Answers1

-3

PAC file is an proxy auto config file which helps the web browsers to pick the best proxy server automatically... the below code is sample setting of proxy using pac file:

proxy.pac.function FindProxyForURL(url, host)

{

if (isInNet(myIpAddress(), "10.10.10.0", "255.255.255.0")

return "PROXY [Proxy Address]:[Port]";

else

return "DIRECT";

}

for more go through this reference url: https://techlib.barracuda.com/wss/configproxywithpacfile

mohammadReza Abiri
  • 1,759
  • 1
  • 9
  • 20
NagaRaju
  • 17
  • 6