Fork of the xtlsapi library with an ip blacklist feature
Project description
xtlsapi
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
Release history Release notifications | RSS feed
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.5.tar.gz
(56.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xtlsapi_ipblacklist-3.3.5.tar.gz.
File metadata
- Download URL: xtlsapi_ipblacklist-3.3.5.tar.gz
- Upload date:
- Size: 56.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e8800248082458daec8f92b215aeb58e8de7aee5baa52dc68a3f22acd895b37
|
|
| MD5 |
e8cc2b512b9ac4a7645ba590d4462073
|
|
| BLAKE2b-256 |
846fdacf748c98a854e4b49d8b4b88b40e7812ea796a2ca15712a91be2a48847
|
File details
Details for the file xtlsapi_ipblacklist-3.3.5-py3-none-any.whl.
File metadata
- Download URL: xtlsapi_ipblacklist-3.3.5-py3-none-any.whl
- Upload date:
- Size: 178.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9fb07066d300bfb62ea6fd345ff2749c8ced8a04f39569180e8373d28f20dab
|
|
| MD5 |
e5702d739098a13f215fe8ec9af68b39
|
|
| BLAKE2b-256 |
e5b2f0a5210abedb5f1398190638d8d83a52ed0286b6cf436cd694c71bf5352d
|