A Python library to handle and parse v2ray links
Project description
v2raypy
v2raypy is a Python library for working with V2Ray configurations and links. It allows you to parse, generate, and manipulate V2Ray nodes (VLESS, VMess, Trojan, Shadowsocks) in both dictionary and link format.
📦 Installation
pip install v2raypy
🚀 Getting Started
Importing
from v2ray import V2ray
📚 Features
- Parse links into config objects:
from_link() - Parse dictionaries into config objects:
from_dict() - Generate configuration dictionaries:
to_dict() - Generate shareable V2Ray links:
gen_link()
🧪 Usage Examples
1. Load from a V2Ray link
link = "vless://<uuid>@example.com:443?security=tls&type=ws#MyServer"
v = V2ray.from_link(link)
2. Load from a Python dictionary
config = {
"tag": "my-vless-node",
"protocol": "vless",
"settings": {
"address": "example.com",
"port": 443,
"uuid": "<uuid>"
},
"streamSettings": {
"network": "ws",
"security": "tls"
}
}
v = V2ray.from_dict(config)
3. Export to dictionary
conf_dict = v.to_dict()
4. Generate a new V2Ray share link
link = v.gen_link()
print(link)
🌐 Supported Protocols
- VLESS
- VMess
- Trojan
- Shadowsocks
Each with full support for stream types like TCP, KCP, WebSocket, gRPC, HTTP Upgrade, XHTTP, and TLS/REALITY security layers.
🛠️ Advanced Configuration
You can manipulate advanced options such as:
MuxSendThroughStreamSettings(including complex nested settings like TLS, WS headers, GRPC options)
📜 Acknowledgements
- 3X-UI (License: GPL-3.0): 3x-ui is a user interface for managing and configuring V2Ray, XRay, and related protocols, with features such as a web-based dashboard and advanced configuration management. It simplifies the setup process and provides a graphical interface for managing server configurations, routing, and security settings.
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
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 v2raypy-1.1.2.tar.gz.
File metadata
- Download URL: v2raypy-1.1.2.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6e08e49c4893e3f32a550b3239724a0666c5e252b80b9524721c416548777dd
|
|
| MD5 |
48959954a2e2aca335d1c5bf1bd205e3
|
|
| BLAKE2b-256 |
3078955ab68bdc54dfccb568b042404183e9bff599b51d7fe7b57de1691425b5
|
File details
Details for the file v2raypy-1.1.2-py3-none-any.whl.
File metadata
- Download URL: v2raypy-1.1.2-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40674c1b74d0d245c3ecb85b63f95010ee6ce532e555e8e5ccb3fbcd753d34e
|
|
| MD5 |
b1c1997dac4d3f667c3d82229e943d7a
|
|
| BLAKE2b-256 |
7fc2d7102a1221b0e343ff98392665437223787b965debee426f783ea5c822ca
|