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 🙏

© 2025 – Pkg Stats / Ryan Hefner

usb-proxy-dev-server

v1.1.4

Published

Proxy 127.0.0.1 to 0.0.0.0 for iPhone USB debugging

Readme

usb-proxy-dev-server

通过 USB 将 iPhone 连接到 Mac 时,在 Mac 上创建一个可被 iPhone 访问的代理服务器。实现无侵入式的iphone → usb → proxyserver → mac → server的调试链路

用途

Mac打开网络共享后,让 iPhone 通过Mac的usb网络ip访问 Mac 上本地运行的服务。并展示Mac的usb网络ip

安装

npm install -g usb-proxy-dev-server

🚀 使用步骤

步骤 1:确保 Mac 与 iPhone 通过 USB 网络共享连接

  1. 连接 iPhone 与 Mac(使用 USB 数据线)。
  2. 在 Mac 上打开: 系统设置 → 通用 → 共享 → 互联网共享 → iPhone USB

Mac USB网络共享设置

步骤 2:启动你在 Mac 上的本地服务

假设你的服务监听在:

http://127.0.0.1:3000

步骤 3:运行代理服务

在终端中运行:

usb-proxy --localPort=<LOCAL_TARGET_PORT> --proxyPort=<PROXY_PORT> [--customCandidates=<CUSTOM_CANDIDATES>]

示例:

usb-proxy --localPort=8082 --proxyPort=7082

这表示:将 Mac 本地的 127.0.0.1:8082 映射到 0.0.0.0:7082,并输出Mac的USB访问ip,供iPhone设备访问。

Mac 输出结果


步骤 4:在 iPhone 上访问你的服务

打开 Safari 或其他浏览器,输入:

http://<Mac的USB网络IP>:7082

如:

http://169.254.92.141:7082

即可访问你的本地服务!


🔧 参数说明

  • <LOCAL_TARGET_PORT>:你希望代理的本地端口(比如开发服务器监听的端口)
  • <PROXY_PORT>:你希望监听的代理端口(供 iPhone 访问)
  • <CUSTOM_CANDIDATES> 自定义网络接口

📌 注意事项

  • 请确保本地服务监听在 127.0.0.1:<LOCAL_TARGET_PORT>
  • 若被防火墙拦截,请允许 Node.js 的入站连接。
  • 若未知IP,请在 Mac 上运行 ifconfigipconfig getifaddr enX 查找实际 iPhone USB 所在的网络接口,并写在customCandidates参数中。
  • 若 iPhone 无法访问,请检查是否关闭VPN。