Thread: Retrieving Firefox Proxy Info in Windows

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    88

    Retrieving Firefox Proxy Info in Windows

    Is there any way to progamatically retrieve the proxy information used by Firefox in Windows 2k/XP/Vista? The information I have found thus far is kind of vague, and I was unable to find any substantial sample code. Thank you for any help you can provide.

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I believe that would mean reading and processing FireFox's configuration files.

    There's a prefs.js file in C:\Documents and Settings\CURRENT_USER\Application Data\Mozilla\Firefox\Profiles\CURRENT_PROFILE\.
    Code:
    //if this line is not present, proxys are off, if the value is 1, 
    //then it's user-specified proxies, if 2, then automatic detection
    user_pref("network.proxy.type", 1);
    //if this line is present and with the value true, then FireFox uses the same proxy for all protocols
    user_pref("network.proxy.share_proxy_settings", true);
    //the proxys and ports (only present if they are set)
    user_pref("network.proxy.ftp", "ftp.example.com");
    user_pref("network.proxy.ftp_port", 21);
    user_pref("network.proxy.gopher", "gopher.example.com");
    user_pref("network.proxy.gopher_port", 150);
    user_pref("network.proxy.http", "www.example.com");
    user_pref("network.proxy.http_port", 80);
    user_pref("network.proxy.socks", "whatever.com");
    user_pref("network.proxy.socks_port", 999);
    user_pref("network.proxy.ssl", "ssl.com");
    user_pref("network.proxy.ssl_port", 132);
    //specifies the socks version of proxies (only present if value is 4)
    user_pref("network.proxy.socks_version", 4);
    Last edited by maxorator; 08-11-2007 at 10:47 AM.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    88
    Thank you for the reply. I know there is API available to handle this. Are you familiar with it at all or know of any sites with example code for it? Thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Network Programming in C for Windows
    By m.mixon in forum C Programming
    Replies: 7
    Last Post: 06-19-2006, 08:27 PM
  2. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 12:56 AM
  3. LoadFromFile() causes Windows 98 to freeze?
    By MidnightlyCoder in forum Windows Programming
    Replies: 8
    Last Post: 03-17-2006, 02:23 PM
  4. Retrieving info from a file...
    By twomers in forum C Programming
    Replies: 2
    Last Post: 01-03-2006, 10:43 AM
  5. Help doing an e-mail program in c...
    By Tyler_Durden in forum C Programming
    Replies: 88
    Last Post: 01-02-2005, 03:12 PM