Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Android Firefox PAC setting not work

687 views
Skip to first unread message

Lu Wei

unread,
Sep 17, 2016, 9:58:47 PM9/17/16
to mozilla-sup...@lists.mozilla.org
I have a PAC file (flora.pac) which works on Firefox PC. The beginning
of file:

// https://github.com/usufu/Flora_Pac/blob/master/flora_pac.pac
var hasOwnProperty = Object.hasOwnProperty;
var iproxy ='DIRECT';
var out_gfw_proxy = 'PROXY 192.168.42.1:8580;';
....
Mainly the purpose is to select a proxy 192.168.42.1:8580 (on local PC)
when URL matches specific patterns, and connect directly on other URLs.

Then I copied it to phone's //sdcard/download (IP address
192.168.42.129), go to about:config of Firefox Android 48.0, changed two
values:

network.proxy.type=2
network.proxy.autoconfig_url=file://sdcard/download/flora.pac

Then, Firefox Android connects normally for those direct URLs, but for
those URLs needing proxy, it cannot connect.

The firewall on local PC is open;
type ftp://192.168.42.1 in address bar of Firefox Android is OK;
type 192.168.42.1:8580 (the proxy server has a webpage on that port) in
address bar of Firefox Android is OK too.

So that makes me think that maybe Firefox Android's PAC support is
broken. Is there anything that I could try?

--
Regards,
Lu Wei
PGP key ID: 0x A12F EF75 92CC E1EA

Ralph Fox

unread,
Sep 18, 2016, 12:55:06 AM9/18/16
to mozilla-sup...@lists.mozilla.org
On Sun, 18 Sep 2016 09:58:02 +0800, Lu Wei wrote:

> I have a PAC file (flora.pac) which works on Firefox PC. The beginning
> of file:
>
> // https://github.com/usufu/Flora_Pac/blob/master/flora_pac.pac
> var hasOwnProperty = Object.hasOwnProperty;
> var iproxy ='DIRECT';
> var out_gfw_proxy = 'PROXY 192.168.42.1:8580;';
> ....
> Mainly the purpose is to select a proxy 192.168.42.1:8580 (on local PC)
> when URL matches specific patterns, and connect directly on other URLs.
>
> Then I copied it to phone's //sdcard/download (IP address
> 192.168.42.129), go to about:config of Firefox Android 48.0, changed two
> values:
>
> network.proxy.type=2
> network.proxy.autoconfig_url=file://sdcard/download/flora.pac


ISTM that should be file:///sdcard/download/flora.pac


> Then, Firefox Android connects normally for those direct URLs, but for
> those URLs needing proxy, it cannot connect.
>
> The firewall on local PC is open;
> type ftp://192.168.42.1 in address bar of Firefox Android is OK;
> type 192.168.42.1:8580 (the proxy server has a webpage on that port) in
> address bar of Firefox Android is OK too.
>
> So that makes me think that maybe Firefox Android's PAC support is
> broken.


Firefox Android's PAC support works for me using the PAC file
from https://calomel.org/proxy_auto_config.html example 2.


> Is there anything that I could try?


Other than changing // to /// as indicated above, I'm not sure.


--
Kind regards
Ralph
🦊

Lu Wei

unread,
Sep 18, 2016, 4:20:32 AM9/18/16
to mozilla-sup...@lists.mozilla.org
On 2016-9-18 12:54, Ralph Fox wrote:
> On Sun, 18 Sep 2016 09:58:02 +0800, Lu Wei wrote:
>
>> I have a PAC file (flora.pac) which works on Firefox PC. The beginning
>> of file:
>>
>> // https://github.com/usufu/Flora_Pac/blob/master/flora_pac.pac
>> var hasOwnProperty = Object.hasOwnProperty;
>> var iproxy ='DIRECT';
>> var out_gfw_proxy = 'PROXY 192.168.42.1:8580;';
>> ....
>> Mainly the purpose is to select a proxy 192.168.42.1:8580 (on local PC)
>> when URL matches specific patterns, and connect directly on other URLs.
>>
>> Then I copied it to phone's //sdcard/download (IP address
>> 192.168.42.129), go to about:config of Firefox Android 48.0, changed two
>> values:
>>
>> network.proxy.type=2
>> network.proxy.autoconfig_url=file://sdcard/download/flora.pac
>
>
> ISTM that should be file:///sdcard/download/flora.pac
>
Thank you, it works! In fact I tried that before, but not work at the
time. Maybe because I did not restart Firefox. I find now the config
change only takes effect after I kill and reopen Firefox manually.

Now a new problem: since Android has a PAC setting in WLAN, I restored
the two network.proxy settings in Firefox, and set in connected Wifi
hotspot PAC URL as "file:///sdcard/download/flora.pac", Then open
Firefox Android or other network Apps to test, but again, direct
connection works and proxy connection doesn't work. I also tried
"/sdcard/download/flora.pac", did a system restart, but still no luck.
What should be the correct form?

Ralph Fox

unread,
Sep 18, 2016, 5:52:55 AM9/18/16
to mozilla-sup...@lists.mozilla.org
According to this discussion on stackoverflow,
apparently Android doesn’t accept setting a local PAC file.

http://stackoverflow.com/questions/29691220/how-to-set-proxy-auto-config-pac-file-in-sdcard-of-android

They suggest putting the PAC file on a web server and
using an http: URL to the PAC file.


--
Kind regards
Ralph
🦊

Lu Wei

unread,
Sep 18, 2016, 11:00:18 PM9/18/16
to mozilla-sup...@lists.mozilla.org
On 2016-9-18 17:52, Ralph Fox wrote:
> ...
> According to this discussion on stackoverflow,
> apparently Android doesn’t accept setting a local PAC file.
>
> http://stackoverflow.com/questions/29691220/how-to-set-proxy-auto-config-pac-file-in-sdcard-of-android

It seems a strange implementation|bug of Android. Is there a Bugzilla
equivalent for Android?
>
> They suggest putting the PAC file on a web server and
> using an http: URL to the PAC file.
>
I can't think of a free place to put the file. I also tried Drony which
the discussion suggested, but it did not work for me.

Ralph Fox

unread,
Sep 19, 2016, 2:08:42 AM9/19/16
to mozilla-sup...@lists.mozilla.org
On Mon, 19 Sep 2016 10:59:21 +0800, Lu Wei wrote:

> On 2016-9-18 17:52, Ralph Fox wrote:
> > ...
> > According to this discussion on stackoverflow,
> > apparently Android doesn’t accept setting a local PAC file.
> >
> > http://stackoverflow.com/questions/29691220/how-to-set-proxy-auto-config-pac-file-in-sdcard-of-android
>
> It seems a strange implementation|bug of Android. Is there a Bugzilla
> equivalent for Android?


If your device is not a Nexus, you may need to report a bug through your
device's own support channel.

See https://source.android.com/source/report-bugs.html

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ QUOTE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This issue tracker is narrowly focused on the Android Open Source
Project. Issues with retail devices need to be reported through
those devices' support channels, especially for devices other than
Nexus.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ QUOTE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


>> They suggest putting the PAC file on a web server and
>> using an http: URL to the PAC file.
>>
> I can't think of a free place to put the file. I also tried Drony which
> the discussion suggested, but it did not work for me.


--
Kind regards
Ralph

Lu Wei

unread,
Sep 19, 2016, 3:37:30 AM9/19/16
to mozilla-sup...@lists.mozilla.org
On 2016-9-19 14:08, Ralph Fox wrote:
> On Mon, 19 Sep 2016 10:59:21 +0800, Lu Wei wrote:
>
>> On 2016-9-18 17:52, Ralph Fox wrote:
>>> ...
>>> According to this discussion on stackoverflow,
>>> apparently Android doesn’t accept setting a local PAC file.
>>>
>>> http://stackoverflow.com/questions/29691220/how-to-set-proxy-auto-config-pac-file-in-sdcard-of-android
>>
>> It seems a strange implementation|bug of Android. Is there a Bugzilla
>> equivalent for Android?
>
>
> If your device is not a Nexus, you may need to report a bug through your
> device's own support channel.

Since it seems a universal problem, I reported it in
https://code.google.com/p/android/issues/detail?id=222818

I'll see if that sound will be heard.
0 new messages