Eli Fulkerson .com HomeProjectsProxy-commandline-tool
 

Proxy.exe

Proxy.exe is a small command line program I whipped up to switch the system proxy settings back and forth and perform a few other tasks that were annoying me semi regularly.

Usage:


Usage: proxy [mode] configname

Modes:
    set     -   sets the system proxy to the configuration named 'configname'
                specified in proxyconfig.xml
    off     -   turns off the system proxy
    on      -   alias for 'proxy set default', requires a 'default' in the
                proxyconfig.xml file.
    dump    -   reads the system proxy settings from the registry and dumps to
                console
    list    -   lists the configname sections in proxyconfig.xml
    parse   -   reads proxyconfig.xml and parses the settings, dumping results
                to console

    gui     -   opens 'Internet Properties' -> 'Connections'
    regedit -   opens regedit, starting at the proxy setting key location

    test    -   connects to the proxy in 'configname' and tries to retrieve
                'http://www.google.com', reports errors and speed

    test all    special case for test, loops through all options in the config
                file and checks each one.  Don't name any of them 'all'.

Download:

proxy.exe (zipped with example config file)
proxy-src.zip

Example XML:

Proxy.exe is assuming the presense of a file "proxyconfig.xml" in the same location as itself. (not your current directory) Things that make sense to be strings are strings. Things that are boolean are "0" or "1". You can have as many named sections as you want. Don't name any of them after the mode names above - a proxy called "test" for instance will confuse the parser since there is a "test" mode.

<?xml version="1.0" encoding="utf-8" ?>
<config>
  <default>
    <add key="http_server_ip" value="10.0.0.1"/>
    <add key="http_server_port" value="3128" />
    <add key="https_server_ip" value="10.0.0.1"/>
    <add key="https_server_port" value="3128" />
    <add key="ftp_server_ip" value="10.0.0.1"/>
    <add key="ftp_server_port" value="3128" />
    <add key="socks_server_ip" value="10.0.0.1"/>
    <add key="socks_server_port" value="3128" />

    <add key="exclude_prefix_list" value="" />
    <add key="use_same_settings_for_all" value="0" />
    <add key="ProxyEnable" value="1" />
    <add key="bypass_local" value="1" />

    <add key="AutoDetect" value="0" />
    <add key="use_AutoConfigURL" value="0" />
    <add key="AutoConfigURL" value="" />

  </default>
  <example>
    <add key="http_server_ip" value="10.0.0.1"/>
    <add key="http_server_port" value="3128" />
    <add key="https_server_ip" value="10.0.0.1"/>
    <add key="https_server_port" value="3128" />
    <add key="ftp_server_ip" value="10.0.0.1"/>
    <add key="ftp_server_port" value="3128" />
    <add key="socks_server_ip" value="10.0.0.1"/>
    <add key="socks_server_port" value="3128" />

    <add key="exclude_prefix_list" value="" />
    <add key="use_same_settings_for_all" value="0" />
    <add key="ProxyEnable" value="1" />
    <add key="bypass_local" value="1" />

    <add key="AutoDetect" value="0" />
    <add key="use_AutoConfigURL" value="0" />
    <add key="AutoConfigURL" value="" />

  </example>
</config>