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
Proxy settings are stored in the preferences. You probably want to change
network.proxy.type,network.proxy.httpandnetwork.proxy.http_port(documentation). Like this:If you need to determine the proxy dynamically for each URL, you can use the functionality provider by
nsIProtocolProxyServiceinterface – it allows you to define a “proxy filter”. Something like this should work: