0

My Android app uses curl to make network calls. I want to find out how I can get the URL that's present in the WiFi proxy auto config in an android device, inside of my application to actually be able to route the charles call through the proxy URL retrieved from the PAC file ?

enter image description here

roopkanta
  • 5
  • 4
Anton Unt
  • 1,835
  • 1
  • 21
  • 47

1 Answers1

0

This question is old, but this might be interesting for anyone else coming from search engines:

Do you know which URL the PAC resides on? If not, I would try to connect to the same WiFi with a PC and do a wireshark trace. When you initiate the connection to the WiFi, an option 252 is sent with the DHCP-lease, specifying where to download the PAC-file from. For example, your client might be told to download http://pac.yoursite.com/pac_file.txt - - - or simething like that.

Then, you can open a browser and navigate to that url, which will download the PAC-file for you to read as JavaScript.

  • thanks for the response, but the problem with this is that it doesn't make it easy for the end user to connect using proxy. – Anton Unt Jul 13 '16 at 08:15
  • This is a well-known problem with Android; proxy auto-configuration doesn't work (except for one Samsung-phone I encountered), and you have to manually specify the PAC-file. My suggestion was how to find out where to get the PAC-file from. To read more about this problem: https://code.google.com/p/android/issues/detail?id=42696 –  Jul 13 '16 at 08:20