1 个不稳定版本

0.1.0 2024年7月26日

#235测试

Download history 115/week @ 2024-07-26 5/week @ 2024-08-02

每月 120 次下载

MIT 许可证

69KB
1.5K SLoC

代理测试器

该仓库包含一个代理测试工具,允许您测试不同代理服务器功能和性能。

注意:这是一个个人使用的工具,因此功能可能不会完全符合您的需求。

安装

先决条件

  • rust
  • libcurl (许多操作系统默认预装。您可能可以忽略此先决条件。否则,安装 cURL 会解决问题。)

要安装代理测试工具,有几种选项

ArchLinux

Arch 用户可以从 AUR 下载 ProxyTester。

Cargo (crates.io)

您可以使用以下命令安装 Crates.io 上发布的最新版本

$ cargo install proxytester

Cargo (Github 源)

您可以使用以下命令安装 Crates.io 上发布的最新版本

$ cargo install --git https://github.com/einstein8612/proxytester.git --tag v0.1.0

使用方法

要了解如何使用 proxytester,您可以查看帮助菜单。

$ proxytester --help

Usage: proxytester.exe [OPTIONS] <FILES>...

Arguments:
  <FILES>...  File to read the proxies from

Options:
  -u, --url <URL>             The URL to test the proxies against [default: https://1.1.1.1]
  -w, --workers <WORKERS>     How many workers to use, ergo how many proxies to test at once [default: 1]
  -t, --timeout <TIMEOUT_MS>  Timeout for each request in milliseconds [default: 5000]
  -h, --help                  Print help
  -V, --version               Print version

示例

$ proxytester --url="http://1.1.1.1" proxies.txt
$ proxytester --workers=5 --url="http://1.1.1.1" proxies.txt

库使用

您还可以将 ProxyTester 用作库,它主要是为此目的而构建的。

let mut proxy_tester = ProxyTesterOptions::default()
    .set_url("http://1.1.1.1".to_owned())
    .set_workers(5)
    .set_timeout(Duration::from_millis(5000))
    .build();

let recv: Receiver<ProxyTest> = proxy_tester.run().await;

// You use the recv channel to read all results as they come in.
// ...

贡献

欢迎贡献,请打开问题或提交拉取请求。

许可证

本项目采用 MIT 许可证

依赖项

~17–26MB
~399K SLoC