Observed since 20 Oct, 19:56 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
This is an interface for 3x-ui panel. It will help developers to create, edit and delete inbounds and clients in a simple way.
The 3x-ui is a JavaScript library designed to facilitate communication with the 3x-ui panel, which runs Xray Core for proxy services. This SDK empowers JavaScript developers to create bots and websites for both commercial and non-commercial uses, providing simplicity, abstraction around the API, caching for improved performance, and mutex for asynchronous safety.
This package is developed based on MHSanaei Postman Collection and you can check it out for more information.
To install the 3x-ui SDK, use npm:
npm install 3x-ui
First, import the SDK:
import { XuiApi } from "3x-ui";
Initialize the SDK with the URL of your 3x-ui panel:
const api = new XuiApi("http://username:password@localhost:2053");
api.debug = true; // Enables debug mode - defualt is false
api.stdTTL = 60; // Cache time in seconds - default is 10s
Then, you can utilize the SDK functions:
const inbounds = await api.getInbounds();
const clientStat = await api.getClient("email or clientId");
const clientOptions = await api.getClientOptions("email or clientId");
const onlines = await api.getOnlineClients();
The SDK uses an underlying proxy agent to connect to the panel. You can specify the proxy settings using environment variables such as HTTP_PROXY and HTTPS_PROXY. Refer to the proxy-agent documentation for more information.
HTTP_PROXY="http://proxy-server-over-tcp.com:3128"
HTTPS_PROXY="https://proxy-server-over-tls.com:3129"
getInbounds(): Returns an array of all inbounds.getInbound(id: number): Returns the inbound with the specified ID.addInbound(options: InboundOptions): Adds a new inbound with the provided options.updateInbound(id: number, options: Partial<InboundOptions>): Updates the inbound with the specified ID using the provided options.resetInboundsStat(): Resets statistics for all inbounds.resetInboundStat(id: number): Resets statistics for the inbound with the specified ID.deleteInbound(id: number): Deletes the inbound with the specified ID.getClient(clientId: string): Returns a client with the given email or clientId.getClientIps(clientId: string): Returns all client's IPs with the given email or clientId.getClientOptions(clientId: string): Returns all client's options with the given email or clientId.addClient(inboundId: number, options: ClientOptions): Adds a new client with the given options.updateClient(clientId: string, options: Partial<ClientOptions>): Updates a client with the given email or clientId.resetClientIps(clientId: string): Resets all client's IPs with the given email or clientId.resetClientStat(clientId: string): Resets a client's stat with the given email or clientId.deleteClient(clientId: string): Deletes a client with the given email or clientId.deleteDepletedClients(): Deletes all clients that have depleted their traffic.deleteInboundDepletedClients(inboundId: number): Deletes all clients of an inbound that have depleted their traffic.getOnlineClients(): Returns all online clients.sendBackup(): send backup file via Telegram bot.For more examples, check out the test directory on our GitHub repository.
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:56 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:fb6c88a17d21c56fe985b29424c91bd34ae279719a22f819c3344fe30131570a