npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whistle

v2.9.87

Published

HTTP, HTTP2, HTTPS, Websocket debugging proxy

Downloads

9,281

Readme

whistle

NPM version node version Test coverage npm download NPM count License

Mac 或 Windows 系统推荐使用客户端版本:https://github.com/avwo/whistle-client

Whistle 是基于 Node 实现的跨平台抓包调试工具,其主要特点:

  1. 完全跨平台:支持 Mac、Windows 等桌面系统,且支持服务端等命令行系统
  2. 功能强大(理论上可以对请求做任意修改)
    • 支持作为 HTTP、HTTPS、SOCKS 代理及反向代理
    • 支持抓包及修改 HTTP、HTTPS、HTTP2、WebSocket、TCP 请求
    • 支持重放及构造 HTTP、HTTPS、HTTP2、WebSocket、TCP 请求
    • 支持设置上游代理、PAC 脚本、Hosts、延迟(限速)请求响应等
    • 支持查看远程页面的 console 日志及 DOM 节点
    • 支持用 Node 开发插件扩展功能,也可以作为独立 npm 包引用
  3. 操作简单
    • 直接通过浏览器查看抓包、修改请求
    • 所有修改操作都可以通过配置方式实现(类似系统 Hosts),并支持分组管理
    • 项目可以自带代理规则配置并一键设置到本地 Whistle 代理,也可以通过定制插件简化操作

一键安装

已安装 brew 的 PC,可以省略以下 1、2 步骤,直接通过以下方式一键安装:brew install whistle && w2 start --init

  1. 安装 Node(建议安装最新的 LTS 版本,如已安装忽略此步骤):https://nodejs.org/
  2. 一键安装,在命令行执行以下命令:
    npm i -g whistle && w2 start --init

    上述命令会先全局安装 Whistle 的 npm 包后,启动 Whistle 并设置系统全局代理,以及安装系统根证书,目前一键安装只支持 Mac & Windows 系统,其它系统按照下面 手动安装 的方式操作。

    如果安装过程时报错 Bad CPU type in executable,在命令执行 arch -x86_64 zsh 再重新执行一键安装命令。

  3. 一键安装过程中注意事项:
    • Mac 需要两次输入开机密码或指纹验证

    • Windows 需要最后点击 “是(Y)” 确认

如果需要自定义代理配置或根证书(如设置其它代理,根证书或代理白名单等)可以通过以下命令实现:

  1. w2 proxy 设置系统全局代理:https://wproxy.org/whistle/proxy.html
  2. w2 ca 设置系统根证书:https://wproxy.org/whistle/proxy.html

也可以用下面 手动安装 方式。

手动安装

非 Mac & Windows 系统或一键安装失败可以按下面方式设置代理和安装根证书:

  1. 设置代理:https://wproxy.org/whistle/install.html
  2. 安装根证书:https://wproxy.org/whistle/webui/https.html

快速上手

安装成功后,用 Chrome 打开链接 http://local.whistlejs.com 即可看到 Whistle 的抓包配置界面:

详细用法参见:Whistle 帮助文档

通过 SwitchyOmega 设置代理

安装 SwitchyOmega

打开 Chrome 扩展商店进行安装 https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif

配置 SwitchyOmega

全局代理如果会影响到某些客户端的请求(客户端设置了 ssl pinning),也可以使用 Chrome 插件设置代理(只对 Chrome 生效):

可以通过 w2 proxy off 关闭全局代理

  1. 设置 Whistle 代理

  2. 选择 Whistle 代理

安全设置

  1. 通过启动参数给管理界面设置用户名密码:w2 restart -n yourusername -w yourpassword
  2. 通过插件给经过代理的请求设置用户名密码:https://github.com/whistle-plugins/whistle.proxyauth

License

MIT