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

ip-report-server

v0.0.40

Published

WebSocket server for IP monitoring

Readme

IP 监控系统

这是一个基于 WebSocket 的IP监控系统,分为3个独立项目,可部署在不同的机器上。

项目结构

ip-report/
├── server/          # Node.js WebSocket 服务器项目
├── client/          # 客户端项目(Node.js)
└── web/             # Web 监控界面项目
    └── docs/        # 构建输出目录

快速开始

从根目录运行(推荐)

# 启动服务器(需要先安装依赖)
npm run server

# 启动客户端(需要先安装依赖)
npm run client

# 启动 Web 界面(需要先安装依赖)
npm run web

1. 服务器项目(server/)

部署到服务器机器上,用于接收客户端报告和向Web客户端广播。

前置要求: 需要安装 Node.js (版本 18+)

从根目录运行:

npm run server

或进入 server 目录运行:

cd server
# 开发模式(WS,端口 8000)
npm run run:dev

# 生产模式(WSS,端口 443)
npm run run:prod

服务器将在开发模式下启动 ws://0.0.0.0:8000,生产模式下启动 wss://0.0.0.0:443

2. 客户端项目(client/)

部署到每台客户端机器上,定期向服务器报告IP信息。

使用 npx(推荐,无需安装):

# 直接运行(默认连接 wss://li.feng3d.com)
npx ip-report

# 自定义客户端名称
CLIENT_NAME="客户端A" npx ip-report

或本地安装后运行:

cd client
npm install
# 开发模式
npm run run:dev

# 生产模式
npm run run:prod

3. Web 界面项目(web/)

Web 监控界面,用于查看所有连接的客户端信息。此项目为私有包,不发布到 npm。

本地运行:

cd web
npm install
# 开发模式
npm run dev

# 生产模式
npm run run:prod

部署架构

┌─────────────┐
│  服务器机器  │  ← 运行 server/ 项目 (Node.js)
│  (端口8000/443) │    提供 WebSocket 服务
│             │    开发: ws://服务器IP:8000
│             │    生产: wss://服务器IP:443
└──────┬──────┘
       │
       ├──────────────┬──────────────┐
       │              │              │
┌──────▼──────┐ ┌─────▼─────┐ ┌─────▼─────┐
│ 客户端机器1 │ │ 客户端机器2│ │ 客户端机器N│
│ 运行client/ │ │ 运行client/│ │ 运行client/│
│  (Node.js)  │ │  (Node.js) │ │  (Node.js) │
└─────────────┘ └────────────┘ └────────────┘

详细文档

每个项目目录下都有独立的 README.md 文件,包含详细的安装和使用说明。

环境变量说明

服务器(server/)- Node.js

  • PORT: WebSocket服务器端口(开发模式默认:8000,生产模式默认:443)
  • HOST: 服务器监听地址(默认:0.0.0.0)
  • NODE_ENV: 运行环境(development 或 production)
  • SSL_KEY_PATH: SSL 密钥文件路径(可选,默认自动查找 ~/ssl/ 目录)
  • SSL_CERT_PATH: SSL 证书文件路径(可选,默认自动查找 ~/ssl/ 目录)

客户端(client/)- Node.js

  • CLIENT_NAME: 客户端名称(可选,默认使用主机名)

Web 界面(web/)- Node.js

  • PORT: HTTP服务器端口(默认:3000)
  • HOST: HTTP服务器监听地址(默认:localhost)

注意事项

  1. 服务器要求

    • 需要安装 Node.js 运行时(版本 18+)
    • 生产环境需要配置 SSL 证书(用于 WSS)
    • 服务器仅提供 WebSocket 服务,不提供 HTTP 页面服务
  2. 防火墙配置

    • 确保防火墙允许 WebSocket 端口的访问(开发:8000,生产:443)
  3. 客户端连接

    • 服务器需要同时允许客户端和Web客户端的连接
    • Web监控界面会自动连接 WebSocket 服务器(页面加载时)
  4. 部署建议

    • 生产环境必须使用 WSS(WebSocket Secure)以确保安全
  5. SSL 证书

    • 生产环境需要有效的 SSL 证书
    • 将证书放置在用户目录的 ssl 文件夹中(如 ~/ssl/example.com.key~/ssl/example.com.pem
    • 系统会自动从证书文件名识别域名并打印正确的访问地址
    • 也可通过 SSL_KEY_PATHSSL_CERT_PATH 环境变量指定路径