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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aisymbiote/ifly

v0.1.9

Published

Dual inbound chain proxy CLI for macOS arm64

Readme

ifly

ifly 是一个给本机程序提供固定本地代理入口的双入口链式代理。

它默认提供两个本地入口:

  • HTTP:127.0.0.1:8341
  • SOCKS5:127.0.0.1:8342

也支持把这两个入口配置成同一个端口,让一个端口同时接受 HTTP 和 SOCKS5。

适合这类场景:

  • 你想让某个本机程序始终走一个固定、可控、只影响它自身的代理入口
  • 你平时会开 Surge / Clash / Stash / sing-box 等本地代理客户端,但不想把远端节点直接塞进客户端里
  • 你希望本地代理客户端可用时走完整链路,不可用时还能自动回退继续工作

安装

npm install -g @aisymbiote/ifly

当前 npm 包首发支持:

  • macOS
  • Apple Silicon(darwin-arm64

安装后默认配置文件路径:

~/ifly/config.yaml

如果安装脚本没有自动生成配置模板,可以手动执行:

ifly init

快速开始

1)准备配置

默认配置文件:

~/ifly/config.yaml

你至少需要配置好 local_proxiesremote_proxies 中的至少一项。

  • 只配 local_proxiesifly 会走 inbounds -> local_proxies -> target
  • 只配 remote_proxiesifly 会走 inbounds -> remote_proxies -> target
  • 两者都配:优先走 inbounds -> local_proxies -> remote_proxies -> target

如果上游代理不需要认证,把模板里的认证字段改成:

username: ""
password: ""

如果你平时会开 Surge / Clash / Stash / sing-box,也建议把它们的本地监听端口填进 local_proxies

如果你想只暴露一个本地入口,也可以把 inbounds 里的 http-in.portsocks-in.port 都设成同一个值,比如都设成 8341

模板示例见:

examples/config.example.yaml

最小配置可以参考这三种:

  1. 只用本地代理客户端:
inbounds:
  - name: http-in
    protocol: http
    host: 127.0.0.1
    port: 8341

  - name: socks-in
    protocol: socks5
    host: 127.0.0.1
    port: 8342

local_proxies:
  - name: local-http
    protocol: http
    host: 127.0.0.1
    port: 6152
    priority: 0
  1. 只用远端专用代理:
inbounds:
  - name: http-in
    protocol: http
    host: 127.0.0.1
    port: 8341

remote_proxies:
  - name: remote-http
    protocol: http
    host: 1.2.3.4
    port: 50100
    username: ""
    password: ""
    priority: 0
  1. 本地代理客户端 + 远端专用代理:
inbounds:
  - name: http-in
    protocol: http
    host: 127.0.0.1
    port: 8341

local_proxies:
  - name: local-http
    protocol: http
    host: 127.0.0.1
    port: 6152
    priority: 0

remote_proxies:
  - name: remote-http
    protocol: http
    host: 1.2.3.4
    port: 50100
    username: ""
    password: ""
    priority: 0

2)前台运行

ifly dev

如果你已经有一份配置文件,想导入为默认配置再运行:

ifly dev \
  -config /path/to/config.yaml

3)验证是否可用

HTTP:

curl -x 'http://127.0.0.1:8341' \
  'https://checkip.amazonaws.com'

SOCKS5:

curl -x 'socks5h://127.0.0.1:8342' \
  'https://checkip.amazonaws.com'

常用命令

初始化默认配置:

ifly init

导入一份配置到默认位置:

ifly init \
  -config /path/to/config.yaml

前台运行:

ifly dev

安装成 macOS 用户级常驻服务:

ifly install \
  -config /path/to/config.yaml

查看状态:

ifly status

实时查看事件日志:

ifly log

重启常驻服务:

ifly restart

卸载常驻服务:

ifly uninstall

文件位置

默认配置:

~/ifly/config.yaml

LaunchAgent plist:

~/Library/LaunchAgents/com.ifly.plist

日志:

~/ifly/logs/ifly.log
~/ifly/logs/ifly.err.log

运行状态与事件订阅:

~/ifly/state/status.json
~/ifly/state/events.sock

常见提示

  • init -config PATHdev -config PATH 都会把那份配置导入到默认配置路径,不是临时切换配置文件。
  • ifly 启动时只做配置语法/结构校验;像 your-port 这种不是合法端口号的值仍然会失败。
  • 测试 SOCKS5 时建议用 socks5h://,让域名通过 SOCKS5 传递,而不是由 curl 在本地先解析。
  • localhost127.0.0.1 和明确的私网/链路本地 IP 目标,ifly 会自动直连,不再送进远端代理链。

更多文档

  • 想看链路选择、健康检查、fallback 回切、状态语义等技术细节: TECHNICAL_SUMMARY.md
  • 想看演进历史: DEVELOPMENT_HISTORY.md
  • 想看原始设计/方案材料: 双入口代理链自动选择方案.md
  • 想看项目动机背景: ifly.md