winproxy

Crates.iowinproxy
lib.rswinproxy
version0.5.1
created_at2025-05-10 23:16:07.825961+00
updated_at2025-11-04 07:10:36.05212+00
descriptionChange Windows system proxy settings
homepage
repositoryhttps://github.com/fhluo/winproxy
max_upload_size
id1668924
size29,957
fhluo (fhluo)

documentation

README

winproxy

Change Windows system proxy settings

build workflow version

English简体中文

Installation

Using Cargo

cargo install winproxy

Using Go

go install github.com/fhluo/winproxy/go/cmd/winproxy@latest

Download Pre-built Binaries

Visit the Releases page to download pre-built binaries.

Usage

View Current Proxy Settings

winproxy

This will display your current proxy configuration in a formatted table.

Enable/Disable Proxy

# Enable proxy
winproxy -p true

# Disable proxy
winproxy -p false

Set Proxy Server

# Set HTTP proxy
winproxy -p true --proxy-address "127.0.0.1:8080"

# Set proxy with bypass list (semicolon-separated)
winproxy -p true --proxy-address "127.0.0.1:8080" --bypass-list "localhost;127.*;<local>"

Library Usage

Add winproxy to your Cargo.toml:

[dependencies]
winproxy = "0.5"

Example usage:

use winproxy::DefaultConnectionSettings;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Read current proxy settings
    let mut settings = DefaultConnectionSettings::from_registry()?;
    println!("Current settings: {:?}", settings);

    // Enable proxy and set address/bypass list
    settings.enable_proxy();
    settings.proxy_address = "127.0.0.1:8080".to_string();
    settings.set_bypass_list_from_str("localhost;127.*;<local>");

    // Apply settings
    settings.version += 1;
    settings.write_registry()?;
    println!("Proxy enabled!");

    Ok(())
}
Commit count: 99

cargo fmt