Skip to main content

Fork of the xtlsapi library with an ip blacklist feature

Project description

xtlsapi

codecov CI

Python library to communicate with xray core

Install it from PyPI

pip install xtlsapi

Usage

from xtlsapi import XrayClient, utils, exceptions

xray_client = XrayClient('1.2.3.4', 1234)
user_id = utils.generate_random_user_id()
user_email = utils.generate_random_email()
inbound_tag = 'inbound-tag'

# Get stats
print(utils.human_readable_bytes(xray_client.get_client_download_traffic('user-email@mail.com')))
print(utils.human_readable_bytes(xray_client.get_client_upload_traffic('user-email@mail.com')))
print(utils.human_readable_bytes(xray_client.get_inbound_download_traffic(inbound_tag)))
print(utils.human_readable_bytes(xray_client.get_inbound_upload_traffic(inbound_tag)))

# Add & Remove client
user = xray_client.add_client(inbound_tag, user_id, user_email)
if user:
    print(user)
    xray_client.remove_client(inbound_tag, user_email)

# restart logger
xray_client.restart_logger()

Development

Read the CONTRIBUTING.md file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xtlsapi_ipblacklist-3.3.3.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xtlsapi_ipblacklist-3.3.3-py3-none-any.whl (178.9 kB view details)

Uploaded Python 3

File details

Details for the file xtlsapi_ipblacklist-3.3.3.tar.gz.

File metadata

  • Download URL: xtlsapi_ipblacklist-3.3.3.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xtlsapi_ipblacklist-3.3.3.tar.gz
Algorithm Hash digest
SHA256 da6d7dd2a40d4a3c2938db1f97f719851aad9d181be1abc124f03192b275adcd
MD5 9a5ffab46d525706eb542cd79db13ab5
BLAKE2b-256 50c91d26fa9c90b0f6fd58f0b0bbd0a077ce403c2a87ce55019ce82bcbab616d

See more details on using hashes here.

File details

Details for the file xtlsapi_ipblacklist-3.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for xtlsapi_ipblacklist-3.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90eedc090a91cb8755f2456ace46090b9070ce0ae2bfab3a13792d5ff15f40d9
MD5 aa4119c7d29ac7f5f0b9733182ee366c
BLAKE2b-256 e9f2f9f710d645188e8caea8822ba15606a4f93b8bf7d20f68f8329300d68b9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page