I was curious too, so I dived into the code in a little:

For mobile  data (i.e. 3g etc), the proxy is set on the APN using the 
mozSettings API to configure the "ril.data.apnSettings" setting[1] . The RIL 
code registers a new network interface [2]  which uses the Gonk 
NetworkManager[3] to set the proxy. NetworkManager uses Gonk NetworkService[4]  
to change the necessary prefs for a proxy to be set. (see [4] for the exact 
prefs)

Wifi also uses the gonk NetworkService [5] directly to set a proxy, although 
seems there is a bug somewhere here. (see Dimi's comment in [6])


[1] 
https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/carrier.js#L290
[2] 
http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/RadioInterfaceLayer.js#2370
[3] 
http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/NetworkManager.js
[4] 
http://mxr.mozilla.org/mozilla-central/source/dom/system/gonk/NetworkService.js#249
[5] http://mxr.mozilla.org/mozilla-central/source/dom/wifi/WifiWorker.js#332
[6] https://bugzilla.mozilla.org/show_bug.cgi?id=938042#c1

On Nov 17, 2013, at 11:18 AM, Jonas Sicking wrote:

> On Nov 13, 2013 2:31 AM, "Frederik Braun" <[email protected]> wrote:
>> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>> 
>> On 13.11.2013 07:37, Paul Theriault wrote:
>>> I was reviewing the mozWifiManager API [1] and I noticed the
>>> setHttpProxy method.  I expected it to set a HTTP proxy on my wifi
>>> connection, but I can't seem to get it work, and its not
>>> documented on mdn yet [2].
>>> 
>> 
>> How is this proxying implemented?
>> 
>> I'm asking because of bug 902346[1] "mozTCPSocket should respect the
>> proxy preferences"
>> In essence: The proxy *prefs* do not affect mozTCPSocket.
> 
> I wonder the same thing. We should tie on with the gecko support that
> already exists for proxies. That way it will affect all network requests.
> 
> Also, why does this live on the wifi API? Is that so that we can support
> different proxy settings for different wifi networks?
> 
> What if the user wants to set a proxy for 3G connections? Is that something
> that people do?
> 
> / Jonas
> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to