Convert Figma logo to code with AI

avwo logowhistle

HTTP, HTTP2, HTTPS, Websocket debugging proxy

15,196
1,142
15,196
79

Top Related Projects

41,196

An interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers.

A fully configurable http/https proxy in NodeJS

A free utility to help web developers watch and manipulate network traffic from their AJAX applications.

11,910

A fast,scalable,distributed game server framework for Node.js.

A full-featured http proxy for node.js

Quick Overview

Whistle is a cross-platform web debugging proxy tool based on Node.js. It provides a powerful set of features for capturing, inspecting, and modifying HTTP/HTTPS traffic between clients and servers, making it an invaluable tool for developers working on web applications and APIs.

Pros

  • Extensive feature set including traffic capture, modification, and simulation
  • User-friendly web interface for easy configuration and management
  • Supports both HTTP and HTTPS traffic interception
  • Highly extensible through plugins and custom rules

Cons

  • Steeper learning curve compared to some simpler proxy tools
  • Documentation can be challenging for non-Chinese speakers, as some parts are primarily in Chinese
  • May require additional setup for HTTPS interception on certain platforms

Getting Started

  1. Install Whistle globally using npm:

    npm install -g whistle
    
  2. Start Whistle:

    w2 start
    
  3. Configure your system or browser to use the Whistle proxy (default: 127.0.0.1:8899)

  4. Access the Whistle web interface at http://localhost:8899/

  5. Begin capturing and analyzing traffic by navigating to your target website or application

Competitor Comparisons

41,196

An interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers.

Pros of mitmproxy

  • More powerful and flexible command-line interface
  • Better support for scripting and automation
  • Stronger focus on security testing and analysis

Cons of mitmproxy

  • Steeper learning curve for beginners
  • Less user-friendly GUI compared to Whistle
  • More complex setup process for certain scenarios

Code Comparison

mitmproxy:

def request(flow):
    if flow.request.host == "example.com":
        flow.request.headers["User-Agent"] = "Custom User Agent"

Whistle:

/example\.com/ reqHeaders://User-Agent/Custom User Agent/

Key Differences

  • mitmproxy is primarily a command-line tool with Python scripting capabilities, while Whistle offers a web-based interface and uses a rule-based system.
  • mitmproxy excels in advanced networking scenarios and security testing, whereas Whistle is more accessible for general web debugging and proxying tasks.
  • Whistle provides a more intuitive visual interface for managing rules and inspecting traffic, making it easier for non-technical users to get started.

Both tools are powerful in their own right, with mitmproxy offering more advanced features and flexibility, while Whistle provides a more user-friendly experience for common web debugging tasks.

A fully configurable http/https proxy in NodeJS

Pros of AnyProxy

  • Simpler setup and configuration process
  • Better documentation and examples for beginners
  • More lightweight and focused on core proxy functionality

Cons of AnyProxy

  • Less feature-rich compared to Whistle
  • Limited built-in UI for rule management and debugging
  • Fewer advanced features for complex scenarios

Code Comparison

AnyProxy:

module.exports = {
  summary: 'a rule to hack response',
  *beforeSendResponse(requestDetail, responseDetail) {
    if (requestDetail.url.indexOf('example.com') > -1) {
      const newResponse = responseDetail.response;
      newResponse.body += '-- modified by anyproxy --';
      return { response: newResponse };
    }
  },
};

Whistle:

exports.handleResponseRules = async (ctx) => {
  const { fullUrl, headers, body } = ctx.response;
  if (fullUrl.indexOf('example.com') > -1) {
    ctx.body = body + '-- modified by whistle --';
  }
};

Both projects offer proxy functionality with rule-based modifications. AnyProxy provides a more straightforward approach, while Whistle offers more advanced features and a built-in UI for rule management. AnyProxy might be better suited for simpler use cases, whereas Whistle excels in complex scenarios with its extensive plugin system and debugging tools.

A free utility to help web developers watch and manipulate network traffic from their AJAX applications.

Pros of BrowserMob Proxy

  • Java-based, integrates well with Selenium WebDriver for automated testing
  • Supports HAR (HTTP Archive) file generation for detailed network analysis
  • More mature project with longer development history

Cons of BrowserMob Proxy

  • Less active development and maintenance compared to Whistle
  • Limited built-in features for request/response manipulation
  • Steeper learning curve for non-Java developers

Code Comparison

BrowserMob Proxy (Java):

Proxy proxy = new BrowserMobProxyServer();
proxy.start(0);
Selenium driver = new ChromeDriver(proxy.seleniumProxy());
proxy.newHar("test");
driver.get("http://example.com");
Har har = proxy.getHar();

Whistle (JavaScript):

const whistle = require('whistle');
const w2 = new whistle();
w2.start({
  port: 8899,
  rules: 'example.com forward://127.0.0.1:8080'
});

Both projects serve as HTTP proxies for debugging and testing, but they cater to different ecosystems. BrowserMob Proxy is more focused on Java-based testing environments, while Whistle offers a more flexible, JavaScript-based approach with a wider range of built-in features for request/response manipulation. Whistle has a more active development community and frequent updates, making it potentially more suitable for modern web development workflows.

11,910

A fast,scalable,distributed game server framework for Node.js.

Pros of Pomelo

  • Designed specifically for game server development, offering scalable and real-time multiplayer game infrastructure
  • Supports multiple programming languages (JavaScript, TypeScript, C#) for game logic implementation
  • Provides built-in components for common game server features like channel management and session handling

Cons of Pomelo

  • Steeper learning curve due to its focus on game server architecture
  • Less versatile for general-purpose web development compared to Whistle
  • Requires more setup and configuration for non-game related projects

Code Comparison

Whistle (HTTP proxy configuration):

exports.handleRequest = async (ctx) => {
  if (ctx.fullUrl.includes('example.com')) {
    ctx.response.body = 'Intercepted';
  }
};

Pomelo (Game server route definition):

app.route('connector', function(session, msg, app) {
  var chatServers = app.getServersByType('chat');
  var res = dispatch(chatServers, session.get('rid'));
  return res.id;
});

Both projects serve different purposes, with Whistle focusing on HTTP debugging and Pomelo on game server development. Whistle offers a more straightforward approach for web developers, while Pomelo provides specialized tools for building scalable game backends.

A full-featured http proxy for node.js

Pros of node-http-proxy

  • Lightweight and focused solely on HTTP proxying
  • Easier to integrate into existing Node.js applications
  • More flexible for custom proxy implementations

Cons of node-http-proxy

  • Limited built-in features compared to Whistle
  • Requires more manual configuration for advanced use cases
  • Less comprehensive documentation and examples

Code Comparison

node-http-proxy:

const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({});

proxy.on('proxyReq', function(proxyReq, req, res, options) {
  proxyReq.setHeader('X-Special-Proxy-Header', 'foobar');
});

Whistle:

exports.handleRequest = function(req, res) {
  req.headers['x-special-proxy-header'] = 'foobar';
  return true;
};

Summary

node-http-proxy is a lightweight and flexible HTTP proxy library for Node.js, ideal for developers who need to integrate proxying functionality into their existing applications. It offers more control over the proxying process but requires more manual configuration.

Whistle, on the other hand, is a more comprehensive proxy tool with a wider range of built-in features and a user-friendly interface. It's better suited for debugging and testing scenarios, offering a more complete out-of-the-box solution.

The choice between the two depends on the specific requirements of your project and the level of control you need over the proxying process.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

whistle logo

whistle

NPM version node version npm download NPM count License

中文 · English

Whistle (发音为 /ˈwisəl/)是一款基于 Node.js 实现的跨平台网络抓包调试工具,具有:

  1. 功能强大
    • 支持 HTTP 代理、HTTPS 代理、Socks 代理、反向代理多种代理模式
    • 支持查看和修改 HTTP、HTTPS、HTTP/2、WebSocket、TCP 请求/响应
    • 内置多种常用调试工具:
      • Weinre:查看远程页面的 DOM 结构、
      • Console:查看 console 日志、
      • Composer:重放及编辑请求
  2. 操作简单
    • 支持通过配置规则修改请求/响应
    • 提供一站式界面,可查看抓包、配置规则、管理插件、操作 Weinre/Console/Composer 等
  3. 可扩展
    • 支持通过插件扩展规则及界面功能
    • 支持作为 NPM 模块被项目引用
  4. 跨平台
    • 支持 macOS、Windows、Linux(Ubuntu/Fedora)等桌面系统
    • 支持无界面 Linux 服务器

安装

macOS、Windows、Linux(Ubuntu/Fedora)等桌面系统推荐使用 Whistle 客户端:https://github.com/avwo/whistle-client

使用 Whistle 客户端可以跳过安装步骤

无界面 Linux 服务器等环境,请按以下 4 个步骤操作:

  1. 安装 Whistle,推荐用 NPM 安装:npm i -g whistle(需要先安装 Node.js:https://nodejs.org/ )

    也支持通过 brew 安装:brew install whistle(需要先安装 brew:https://brew.sh/ )

  2. 启动 Whistle,命令行执行:w2 start

  3. **安装根证书**,命令行执行:w2 ca

    根证书安装过程可能需要手动确认:

    Windows 需要最后点击 “是(Y)” 确认 点击 是(Y)
    macOS 需要输入开机密码或指纹验证 输入开机密码 输入指纹
  4. 设置代理,命令行执行:w2 proxy

    macOS 首次设置代理可能需要输入锁屏密码

    设置指定 IP 或端口:w2 proxy "10.x.x.x:8888"

    关闭系统代理:w2 proxy 0

    其它设置代理的方式:

    1. (推荐) 通过安装 Chrome 插件 ZeroOmega 设置代理:https://chromewebstore.google.com/detail/proxy-switchyomega-3-zero/pfnededegaaopdmhkdmcofjmoldfiped (无法访问可手动安装:https://chrome.zzzmh.cn/info/pfnededegaaopdmhkdmcofjmoldfiped)

    2. 直接在客户端上设置代理,如 FireFox、微信开发者工具等内置了设置代理功能

      FireFox 设置代理示例图 image
    3. 通过 Proxifier 设置代理(针对无法设置代理且不使用系统代理的客户端):https://www.proxifier.com/docs/win-v4/http-proxy.html

快速上手

详细使用指南请参考:https://wproxy.org/docs/getting-started.html

License

MIT

NPM DownloadsLast 30 Days