TopGit theo dõi zzzgydi/sysproxy-rs trên GitHub, đã đạt 74 sao. A Rust library for set/get system proxy. Supports Windows, macOS and linux (via gsettings).
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A library for getting and setting system proxies. Supports Windows, macOS and Linux (via gsettings/kconfig).
macOS network services
The existing Sysproxy::get_http, get_https, get_socks and corresponding
setters operate on a named service such as Wi-Fi. Autoproxy also provides
get_auto_proxy_for_service and set_auto_proxy_for_service for PAC.
The default-service convenience methods remain available.
For service discovery, independent protocol control, or a custom command runner,
use macos::Networksetup:
use sysproxy::{macos::{Networksetup, ProxyType}, Sysproxy};
fn configure(service: &str) -> sysproxy::Result<()> {
let mut network = Networksetup::default();
let http = network.get_proxy(ProxyType::Http, service)?;
let pac = network.get_auto_proxy(service)?;
let bypass = network.get_bypass(service)?;
// Save these values, and the other protocols, if your application needs rollback.
println!("HTTP: {http:?}; PAC: {pac:?}; bypass: {bypass}");
let proxy = Sysproxy {
enable: true,
host: "127.0.0.1".into(),
port: 7897,
bypass: String::new(),
};
network.set_proxy(ProxyType::Http, service, &proxy)?;
network.set_bypass(service, "localhost,127.0.0.1,*.local")?;
network.set_auto_proxy_enabled(service, false)?;
Ok(())
}
Networksetup::list_network_services() returns enabled services in system order.
get_proxy and set_proxy handle one protocol; bypass is read and written
separately. get_system_proxy() combines protocol values into one convenience
value, so applications restoring independent settings should read each protocol.
The default runner invokes /usr/sbin/networksetup with LC_ALL=C. Every read
and write checks the exit status; command failures include stdout and stderr in
Error::Io. Malformed responses return Error::ParseStr.
Write and restore behavior
Setters can perform multiple OS commands and are not atomic. A successful
endpoint/URL write followed by a failed switch write leaves partial changes.
The application owns snapshots, rollback, persistence and policy across services.
macOS enables a protocol when its endpoint is written. Restoring a disabled
but configured endpoint writes the saved endpoint, then switches it off.
An unconfigured disabled manual proxy is represented by an empty host and
port 0. Reading a blank port also accepts that state. Active proxies require a
nonempty host and nonzero port. Incomplete endpoints are rejected even when
disabled; only an empty host with port 0 represents an unconfigured endpoint.
Setting an empty disabled manual endpoint only switches it off; it does not
erase the saved endpoint. set_proxy_enabled and set_auto_proxy_enabled
always change only the switch and preserve the saved endpoint or PAC URL.
PAC setters write both URL and switch. For an empty disabled URL they retain
the original networksetup -setautoproxyurl behavior of passing two literal
quote characters (""), followed by switching PAC off. The getter normalizes
that representation to an empty string. This does not guarantee removal of
the underlying SystemConfiguration key. Use set_auto_proxy_enabled when
the saved URL should remain unchanged.
Bypass uses comma-separated entries. Empty entries are skipped and whitespace
is trimmed. An empty list or a single Empty token (case-insensitive) clears
the OS list. Mixing Empty with domains, control characters and leading-option
entries are rejected. set_system_proxy validates endpoint and bypass before
changing any protocol.
Custom runners and tests
Networksetup::new(runner) accepts an owned runner or &mut runner. Implement
macos::CommandRunner::run(&mut self, args: &[&str]) -> std::io::Result<std::process::Output>.
Return the actual status, stdout and stderr: Networksetup performs the checks
and parsing. This lets tests use the production logic without changing PATH or
system settings. See tests/macos_networksetup.rs for examples.
Optional utilities
The default iptools feature enables sysproxy::utils. If only proxy control is
needed, use default-features = false; the utilities module is then omitted.
Testing
cargo test
cargo test --no-default-features
cargo clippy --all-targets --all-features -- -D warnings
On macOS these run isolated backend tests. Tests requiring a configured desktop
network service or changing real system proxies are ignored by default. The
ignored setter smoke tests do not restore the original settings; run them only
on a disposable machine, selecting the exact test explicitly.
CI explicitly runs cargo test --test test -- --ignored --test-threads=1 on
disposable Windows runners and on Linux with an isolated D-Bus session and
configuration directory. These exercise the actual platform backend. macOS CI
runs injected-runner tests; real macOS writes still require separate validation.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/zzzgydi/sysproxy-rs là nguồn chính thức.
zzzgydi/sysproxy-rs có bao nhiêu sao?
zzzgydi/sysproxy-rs có 74 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/zzzgydi/sysproxy-rs. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
zzzgydi/sysproxy-rs có phải mã nguồn mở không?
Có — zzzgydi/sysproxy-rs phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/zzzgydi/sysproxy-rs.
zzzgydi/sysproxy-rs còn đang phát triển không?
Commit gần nhất trên zzzgydi/sysproxy-rs là 2 tháng trước (theo timestamp GitHub). Repo có 60 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
zzzgydi/sysproxy-rs dùng license gì?
zzzgydi/sysproxy-rs phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
zzzgydi/sysproxy-rs là gì?
zzzgydi/sysproxy-rs (zzzgydi/sysproxy-rs) là dự án Rust trên GitHub. Theo mô tả gốc: A Rust library for set/get system proxy. Supports Windows, macOS and linux (via gsettings).
zzzgydi/sysproxy-rs viết bằng ngôn ngữ gì?
zzzgydi/sysproxy-rs chủ yếu viết bằng Rust. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc sysproxy-rs có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về sysproxy-rs.