Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:08:15+00:00 2026-06-04T00:08:15+00:00

I have a proxy server running on localhost (127.0.0.1) and i have grown tired

  • 0

I have a proxy server running on localhost (127.0.0.1) and i have grown tired of having to train users on how to switch proxies in firefox to bypass blocked websites.
I decided to write an addon. I wonder how to use xpcom to tell firefox to use a certain proxy eg
for http, use 127.0.0.1 port 8080.
Examples on the internet are scarce.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:08:17+00:00Added an answer on June 4, 2026 at 12:08 am

    Proxy settings are stored in the preferences. You probably want to change network.proxy.type, network.proxy.http and network.proxy.http_port (documentation). Like this:

    Components.utils.import("resource://gre/modules/Services.jsm");
    Services.prefs.setIntPref("network.proxy.type", 1);
    Services.prefs.setCharPref("network.proxy.http", "127.0.0.1");
    Services.prefs.setIntPref("network.proxy.http_port", 8080);
    

    If you need to determine the proxy dynamically for each URL, you can use the functionality provider by nsIProtocolProxyService interface – it allows you to define a “proxy filter”. Something like this should work:

    var pps = Components.classes["@mozilla.org/network/protocol-proxy-service;1"]
              .getService(Components.interfaces.nsIProtocolProxyService);
    
    // Create the proxy info object in advance to avoid creating one every time
    var myProxyInfo = pps.newProxyInfo("http", "127.0.0.1", 8080, 0, -1, 0);
    
    var filter = {
      applyFilter: function(pps, uri, proxy)
      {
        if (uri.spec == ...)
          return myProxyInfo;
        else
          return proxy;
      }
    };
    pps.registerFilter(filter, 1000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like a proxy server (written in java) running between my clients
Ok, I have two Linux boxes running behind a proxy server. Both boxes are
To change Proxy server I have to go to IE->Internet Options->LAN Settings and click
I'm looking to write a simple proxy server in .NET. Does anyone have any
I have an LCDS server sitting behind a corporate proxy/firewall. I need to use
We have several cron jobs that ftp proxy logs to a centralized server. These
I am running an Apache 2.2.3 proxy server to hide my backend machines from
I am running nginx 0.6.32 as a proxy front-end for couchdb. I have my
On my development system I have a Solr server running that is queried by
At my place of employment we have a temperamental proxy server which often makes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.