Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

node-sbx

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sbx

node-sbx

npmnpm
Version
1.0.1
Version published
Weekly downloads
457
-26.53%
Maintainers
1
Weekly downloads
 
Created
Source

SBX - 多功能代理节点部署工具

npm version npm downloads License

SBX是一个强大的多功能代理节点部署工具,支持多种协议(VMess、VLESS、Hysteria2、TUIC、Reality),集成了Argo隧道和哪吒探针功能。专为PaaS平台和VPS环境设计。

✨ 特性

  • 🚀 多协议支持: VMess、VLESS、Hysteria2、TUIC、Reality
  • 🌐 Argo隧道: 支持临时和固定隧道
  • 📊 哪吒探针: 集成v0和v1版本
  • 🔧 自动配置: 智能识别系统架构并下载对应文件
  • 🌐 智能出站: 自动检测YouTube可访问性,智能配置出站规则
  • 📱 Telegram推送: 支持节点信息推送到TG
  • 🔄 自动上传: 支持节点自动上传到订阅器

🚀 快速开始

安装

# 全局安装(推荐)
npm install -g node-sbx

# 使用yarn
yarn global add node-sbx

# 使用pnpm
pnpm add -g node-sbx

基本使用

# 直接运行(使用默认配置)
node-sbx

# 使用npx运行
npx node-sbx

# 设置环境变量运行
 PORT=3000 node-sbx

⚙️ 环境变量配置

创建配置文件

# 复制示例文件
cp .env.example .env

# 编辑配置文件
nano .env

环境变量说明

变量名是否必须默认值说明
UPLOAD_URL-订阅或节点自动上传地址
PROJECT_URL-项目分配的域名
AUTO_ACCESSfalse是否开启自动访问保活
FILE_PATH./.npm订阅文件保存路径
SUB_PATHsub订阅路径
UUIDaca4e9de-9705-428c-a8f2-3c34938dc62c用户UUID
NEZHA_SERVER-哪吒面板地址
NEZHA_PORT-哪吒端口(v0需要)
NEZHA_KEY-哪吒密钥
ARGO_DOMAIN-Argo固定隧道域名
ARGO_AUTH-Argo固定隧道token或json
ARGO_PORT8001Argo隧道端口
TUIC_PORT-TUIC端口,设置为有效端口号(1-65535)
HY2_PORT-Hysteria2端口,设置为有效端口号(1-65535)
REALITY_PORT-Reality端口,设置为有效端口号(1-65535)
CFIPwww.visa.com.tw优选域名或IP
CFPORT443优选端口
PORT3000HTTP服务端口
NAMEVls节点名称前缀
CHAT_ID-Telegram chat_id
BOT_TOKEN-Telegram bot_token

配置示例

# 基本配置
export UPLOAD_URL="https://your-merge-sub-domain.com"
export PROJECT_URL="https://your-project-domain.com"
export PORT=3000
export UUID="your-uuid-here"

# 哪吒探针配置
export NEZHA_SERVER="nz.your-domain.com:8008"
export NEZHA_KEY="your-nezha-key"

# Argo隧道配置
export ARGO_DOMAIN="your-argo-domain.com"
export ARGO_AUTH="your-argo-token"

# Telegram推送配置
export CHAT_ID="your-chat-id"
export BOT_TOKEN="your-bot-token"

📦 作为npm模块使用

// CommonJS
const sbx = require('node-sbx');

// ES6 Modules
import sbx from 'node-sbx';

🔧 后台运行

使用screen(推荐)

# 创建screen会话
screen -S sbx

# 运行应用
sbx

# 按 Ctrl+A 然后按 D 分离会话
# 重新连接:screen -r sbx

使用tmux

# 创建tmux会话
tmux new-session -d -s sbx

# 运行应用
tmux send-keys -t sbx "sbx" Enter

# 分离会话:tmux detach -s sbx
# 重新连接:tmux attach -t sbx

使用PM2

# 安装PM2
npm install -g pm2

# 启动应用
pm2 start sbx --name "sbx-service"

# 管理应用
pm2 status
pm2 logs sbx-service
pm2 restart sbx-service

使用systemd(Linux系统服务)

# 创建服务文件
sudo nano /etc/systemd/system/sbx.service

服务文件内容:

[Unit]
Description=SBX Proxy Service
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root
Environment=UPLOAD_URL=https://your-domain.com
Environment=PROJECT_URL=https://your-project.com
Environment=PORT=3000
ExecStart=/usr/bin/sbx
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

启动服务:

sudo systemctl daemon-reload
sudo systemctl start sbx
sudo systemctl enable sbx
sudo systemctl status sbx

🌐 订阅地址

  • 标准端口: https://your-domain.com/sub
  • 非标端口: http://your-domain.com:port/sub

🔧 端口配置说明

动态节点生成规则:

  • TUIC节点: 当 TUIC_PORT 设置为有效端口号(1-65535)时生成
  • Hysteria2节点: 当 HY2_PORT 设置为有效端口号(1-65535)时生成
  • Reality节点: 当 REALITY_PORT 设置为有效端口号(1-65535)时生成

端口验证规则:

  • 有效端口: 1-65535 之间的正整数
  • 无效端口: 空值、非数字、小于1或大于65535的数值
  • 未设置: 不生成对应的节点配置

🌐 智能出站配置

工作原理:

  • 自动优化: 如果YouTube不可访问,自动添加YouTube出站规则到wireguard-out

优势:

  • 无需手动配置: 系统自动检测并优化出站规则
  • 智能分流: 根据网络环境自动选择最佳出站路径
  • 提升体验: 确保YouTube等流媒体服务的最佳访问体验

## 🔄 更新

```bash
# 更新全局安装的包
npm update -g @eooce/sbx

# 或者重新安装
npm uninstall -g @eooce/sbx
npm install -g @eooce/sbx

📚 更多信息

⚠️ 注意事项

  • 端口配置: 确保配置的端口在防火墙中开放
  • UUID安全: 建议使用随机生成的UUID,避免使用默认值
  • 文件权限: 确保程序有足够的权限创建和写入文件
  • 网络环境: 某些网络环境可能需要配置代理

🤝 贡献

欢迎提交Issue和Pull Request来改进这个项目!

📄 许可证

本项目采用MIT许可证 - 查看LICENSE文件了解详情。

免责声明

本程序仅供学习了解,非盈利目的,请于下载后24小时内删除,不得用作任何商业用途。使用本程序必须遵守部署服务器所在地、所在国家和用户所在国家的法律法规,程序作者不对使用者任何不当行为负责。

Keywords

proxy

FAQs

Package last updated on 23 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts