定制 hadi-aj/v2ray-panels 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hadi-aj/v2ray-panels

最新稳定版本:v1.0.0

Composer 安装命令:

composer require hadi-aj/v2ray-panels

包简介

A PHP client library for integrating with Sanaei and Marzban panels, providing a simple interface to manage and interact with VPN services programmatically.

README 文档

README

A PHP client library for integrating with Sanaei (3x‑UI) and Marzban proxy/V2Ray/Xray management panels — providing a unified, code-friendly interface for panel automation.

🔧 Overview

  • Designed to work with the 3x‑UI (Sanaei panel) and Marzban proxies management systems developed in Go/JS/Python.
  • Exposes REST API access via PHP classes with type hints and PHPDoc for full IDE auto-completion and static analysis.
  • Ideal for automating user management, client subscriptions, traffic monitoring, panel configuration, backups, and Telegram bot integrations.

🚀 Why Use This Library?

  • Seamlessly integrates with panels like 3x‑UI/Sanaei and Marzban.
  • Provides strongly-typed PHP classes to consume both panel APIs—no need to manually craft HTTP requests.
  • PHPDoc-enhanced, so modern IDEs (PHPStorm, VSCode, etc.) offer parameter hints, return types, and in-line documentation.

🧩 Installation

Install via Composer:

composer require hadi-aj/v2ray-panels

🗂 Panel Support

  • 3x‑UI (Sanaei panel): A fork of X‑UI supporting multi-protocol V2Ray/Xray inbound configuration, traffic limits, expiry, and more.
  • Marzban panel: A modern GUI for Xray-core with REST API, multi-node support, share link generation, CLI, webhook, Telegram bot and system monitoring.

💡 Usage Examples

<?php
require 'vendor/autoload.php';

use HadiAj\V2rayPanels\SanaeiClient;
use HadiAj\V2rayPanels\MarzbanClient;

$sanaei = new SanaeiClient('https://panel.example.com', 'API_TOKEN');
$marzban = new MarzbanClient('https://marzban.example.com/api', 'API_TOKEN');

// Fetch all clients from Sanaei
$sanaeiClients = $sanaei->getClients();

// Create a new client on Marzban
$new = $marzban->createClient([
    'email'   => 'user@example.com',
    'limit'   => '5GB',
    'expiry'  => '2025-09-01',
]);

⚙️ Key Features

  • ✅ Unified PHP API for both Sanaei and Marzban panels
  • ✅ Fully documented classes/interfaces powered by PHPDoc for IntelliSense
  • ✅ Client/inbound/tracking/subscription management with CRUD support
  • ✅ Traffic stats, usage limits, expiry notifications via Telegram bots or webhooks
  • 🌐 Supports multi-node Marzban deployment and panel configuration features
  • 🔐 Secure access with token-based authentication, SSL support, and safe HTTP operations

📝 Documentation & API Reference

Full API endpoints and parameter references are documented in PHPDoc. You can also inspect the original panel docs:

🤝 Contribution

Contributions are welcome! Suggestions, bug reports, or feature additions:

  1. Fork the repository
  2. Develop your feature or fix
  3. Submit a pull request

Please follow PSR‑12 coding standards and include relevant tests for new features.

📄 License

Licensed under MIT License. See LICENSE file in the repository.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-05