diff --git a/.github/workflows/api-ci.yml b/.github/workflows/api-ci.yml
@@ -5,15 +5,12 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- - name: Set up Python ${{ matrix.python-version }}
+ - name: Set up Python 3.11.2
uses: actions/setup-python@v3
with:
- python-version: ${{ matrix.python-version }}
+ python-version: 3.11.2
- name: Install dependencies
run: |
@@ -23,14 +20,4 @@ jobs:
- name: Lint with pylint
run: |
- OUTPUT=$(pylint ./app --exit-zero)
- echo "MESSAGE=$OUTPUT" >> $GITHUB_ENV
-
- - name: Post Lint result to PR
- uses: mshick/add-pr-comment@v1
- with:
- message: ${{ env.MESSAGE }}
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- repo-token-user-login: 'github-actions[bot]'
- allow-repeats: false
-
+ pylint --exit-zero $(git ls-files '*.py')
diff --git a/app/db/crud.py b/app/db/crud.py
@@ -1,3 +1,4 @@
+import json
from datetime import datetime
from enum import Enum
from typing import Dict, List, Optional, Tuple, Union
@@ -6,10 +7,10 @@ from sqlalchemy import and_, delete
from sqlalchemy.orm import Session
from app.db.models import (JWT, TLS, Admin, Node, NodeUsage, NodeUserUsage,
- NotificationReminder, #Proxy,
+ NotificationReminder,
InboundHost, Service,
Inbound, ProxyTypes, System, User,
- UserUsageResetLogs)
+ UserUsageResetLogs)
from app.models.admin import AdminCreate, AdminModify, AdminPartialModify
from app.models.node import (NodeCreate, NodeModify, NodeStatus,
NodeUsageResponse)
@@ -33,17 +34,19 @@ def add_default_hosts(db: Session, inbounds: List[Inbound]):
def assure_node_inbounds(db: Session, inbounds: List[Inbound], node_id: int):
existing_inbounds = set((i.protocol, i.tag) for i in db.query(Inbound).filter(Inbound.node_id == node_id).all())
- inbounds_set = set((i.protocol, i.tag) for i in inbounds)
+ inbounds_set = set((json.loads(i.config)["protocol"], i.tag) for i in list(inbounds))
+ new_inbounds = inbounds_set - existing_inbounds
+ deleted_inbounds = existing_inbounds - inbounds_set
# difference = [ i for i in existing_inbounds if (i.protocol, i.tag) not in existing_inbounds ]
- if not inbounds_set.difference(existing_inbounds) and not existing_inbounds.difference(inbounds_set):
+ if not new_inbounds and not deleted_inbounds:
return
- stmt = (
+ """stmt = (
delete(Inbound)
- .where( Inbound.node_id == node_id )
+ .where(Inbound.node_id == node_id)
.execution_options(synchronize_session="fetch")
)
- db.execute(stmt)
- new_inbounds = [Inbound(tag=i.tag, protocol=i.protocol, node_id=node_id) for i in inbounds]
+ db.execute(stmt)"""
+ new_inbounds = [Inbound(tag=i[1], protocol=i[0], node_id=node_id) for i in new_inbounds]
db.add_all(new_inbounds)
db.flush()
for i in new_inbounds:
@@ -52,23 +55,27 @@ def assure_node_inbounds(db: Session, inbounds: List[Inbound], node_id: int):
db.commit()
-def get_node_users(db: Session, statuses: List[UserStatus], node_id: Optional[int]):
- query = db.query(User.id, User.username, User.key, Inbound.protocol, Inbound.tag).distinct(
+def get_node_users(db: Session, node_id: Optional[int], statuses: Optional[List[UserStatus]] = None):
+ query = db.query(User.id, User.username, User.key, Inbound).distinct(
).join(Inbound.services).join(Service.users).filter(Inbound.node_id == node_id)
- if statuses:
+ if isinstance(statuses, list):
query = query.filter(User.status.in_(statuses))
return query.all()
+
def get_user_hosts(db: Session, user_id: int):
return db.query(InboundHost).distinct().join(User.services).join(Service.inbounds).join(Inbound.hosts).filter( User.id == user_id ).all()
+
def get_all_hosts(db: Session) -> Dict[int, InboundHost]:
all_inbounds = db.query(Inbound).all()
return {i.id: i.hosts for i in all_inbounds}
+
def get_inbound_hosts(db: Session, inbound_id: int) -> List[InboundHost]:
return db.query(InboundHost).filter(InboundHost.inbound_id == inbound_id).all()
+
def get_all_inbounds(db: Session):
return db.query(Inbound).all()
@@ -505,9 +512,11 @@ def create_service(db: Session, service: Service) -> Service:
def get_service(db: Session, service_name: str) -> Service:
return db.query(Service).filter( Service.name == service_name ).first()
+
def get_services(db: Session) -> List[Service]:
return db.query(Service).all()
+
def get_node(db: Session, name: str):
return db.query(Node).filter(Node.name == name).first()
@@ -534,7 +543,7 @@ def get_nodes(db: Session,
def get_nodes_usage(db: Session, start: datetime, end: datetime) -> List[NodeUsageResponse]:
- usages = {}
+ usages = dict()
usages[0] = NodeUsageResponse( # Main Core
node_id=None,
@@ -565,8 +574,7 @@ def get_nodes_usage(db: Session, start: datetime, end: datetime) -> List[NodeUsa
def create_node(db: Session, node: NodeCreate):
dbnode = Node(name=node.name,
address=node.address,
- port=node.port,
- api_port=node.api_port)
+ port=node.port)
db.add(dbnode)
db.commit()
@@ -590,15 +598,12 @@ def update_node(db: Session, dbnode: Node, modify: NodeModify):
if modify.port is not None:
dbnode.port = modify.port
- if modify.api_port is not None:
- dbnode.api_port = modify.api_port
-
if modify.status is NodeStatus.disabled:
dbnode.status = modify.status
dbnode.xray_version = None
dbnode.message = None
else:
- dbnode.status = NodeStatus.connecting
+ dbnode.status = NodeStatus.unhealthy
if modify.usage_coefficient:
dbnode.usage_coefficient = modify.usage_coefficient
@@ -629,7 +634,7 @@ def create_notification_reminder(
def get_notification_reminder(
db: Session, user_id: int, reminder_type: ReminderType,
-) -> Union[NotificationReminder, None]:
+) -> Optional[NotificationReminder]:
reminder = db.query(NotificationReminder).filter(
NotificationReminder.user_id == user_id).filter(
NotificationReminder.type == reminder_type).first()
diff --git a/app/db/migrations/versions/20faa9f18c0a_init.py b/app/db/migrations/versions/20faa9f18c0a_init.py
@@ -43,7 +43,6 @@ def upgrade() -> None:
sa.Column('name', sa.String(length=256, collation='NOCASE'), nullable=True),
sa.Column('address', sa.String(length=256), nullable=False),
sa.Column('port', sa.Integer(), nullable=False),
- sa.Column('api_port', sa.Integer(), nullable=False),
sa.Column('xray_version', sa.String(length=32), nullable=True),
sa.Column('status', sa.Enum('connected', 'connecting', 'error', 'disabled', name='nodestatus'), nullable=False),
sa.Column('last_status_change', sa.DateTime(), nullable=True),
diff --git a/app/db/models.py b/app/db/models.py
@@ -7,7 +7,6 @@ from sqlalchemy import (BigInteger, Boolean, Column, DateTime, Enum,
from sqlalchemy.orm import relationship
from sqlalchemy.sql.expression import text
-from app import xray
from app.db.base import Base
from app.models.node import NodeStatus
from app.models.proxy import (InboundHostALPN, InboundHostFingerprint,
@@ -59,12 +58,19 @@ class User(Base):
username = Column(String(32, collation='NOCASE'), unique=True, index=True)
key = Column(String(64), unique=True, index=True)
services = relationship("Service", secondary=users_services, back_populates="users", lazy="joined")
- inbounds = relationship("Inbound", secondary="join(users_services, inbounds_services, inbounds_services.c.service_id == users_services.c.service_id).join(Inbound, Inbound.id == inbounds_services.c.inbound_id)", viewonly=True, distinct_target_key=True, lazy="joined")
+ inbounds = relationship(
+ "Inbound",
+ secondary="join(users_services, inbounds_services, inbounds_services.c.service_id == users_services.c.service_id)"
+ ".join(Inbound, Inbound.id == inbounds_services.c.inbound_id)", viewonly=True,
+ distinct_target_key=True,
+ lazy="joined")
# proxies = relationship("Proxy", back_populates="user", cascade="all, delete-orphan")
status = Column(Enum(UserStatus), nullable=False, default=UserStatus.active)
used_traffic = Column(BigInteger, default=0)
- node_usages = relationship("NodeUserUsage", back_populates="user", cascade="all,delete,delete-orphan", lazy="joined")
- notification_reminders = relationship("NotificationReminder", back_populates="user", cascade="all,delete,delete-orphan")
+ node_usages = relationship("NodeUserUsage", back_populates="user", cascade="all,delete,delete-orphan",
+ lazy="joined")
+ notification_reminders = relationship("NotificationReminder", back_populates="user",
+ cascade="all,delete,delete-orphan")
data_limit = Column(BigInteger, nullable=True)
data_limit_reset_strategy = Column(
Enum(UserDataLimitResetStrategy),
@@ -97,20 +103,6 @@ class User(Base):
@property
def last_traffic_reset_time(self):
return self.usage_logs[-1].reset_at if self.usage_logs else self.created_at
- """
- @property
- def inbounds(self):
- _ = {}
- for proxy in self.proxies:
- _[proxy.type] = []
- excluded_tags = [i.tag for i in proxy.excluded_inbounds]
- for inbound in xray.config.inbounds_by_protocol.get(proxy.type, []):
- if inbound["tag"] not in excluded_tags:
- _[proxy.type].append(inbound["tag"])
-
- return _
- """
-
class UserUsageResetLogs(Base):
@@ -123,7 +115,6 @@ class UserUsageResetLogs(Base):
reset_at = Column(DateTime, default=datetime.utcnow)
-
class Inbound(Base):
__tablename__ = "inbounds"
@@ -140,9 +131,6 @@ class Inbound(Base):
class InboundHost(Base):
__tablename__ = "hosts"
- # __table_args__ = (
- # UniqueConstraint('inbound_tag', 'remark'),
- # )
id = Column(Integer, primary_key=True)
remark = Column(String(256), unique=False, nullable=False)
@@ -207,12 +195,11 @@ class Node(Base):
__tablename__ = "nodes"
id = Column(Integer, primary_key=True, index=True)
name = Column(String(256, collation='NOCASE'), unique=True)
- address = Column(String(256), unique=False, nullable=False)
- port = Column(Integer, unique=False, nullable=False)
- api_port = Column(Integer, unique=False, nullable=False)
+ address = Column(String(256), unique=False, nullable=True)
+ port = Column(Integer, unique=False, nullable=True)
xray_version = Column(String(32), nullable=True)
inbounds = relationship("Inbound", back_populates="node")
- status = Column(Enum(NodeStatus), nullable=False, default=NodeStatus.connecting)
+ status = Column(Enum(NodeStatus), nullable=False, default=NodeStatus.unhealthy)
last_status_change = Column(DateTime, default=datetime.utcnow)
message = Column(String(1024), nullable=True)
created_at = Column(DateTime, default=datetime.utcnow)
diff --git a/app/discord/__init__.py b/app/discord/__init__.py
@@ -1,21 +0,0 @@
-handler_names = ["report"]
-
-from .handlers.report import ( # noqa
- send_webhook,
- report_new_user,
- report_user_modification,
- report_user_deletion,
- report_status_change,
- report_user_usage_reset,
- report_user_subscription_revoked
-)
-
-__all__ = [
- "send_webhook",
- "report_new_user",
- "report_user_modification",
- "report_user_deletion",
- "report_status_change",
- "report_user_usage_reset",
- "report_user_subscription_revoked"
-]
diff --git a/app/discord/handlers/report.py b/app/discord/handlers/report.py
@@ -1,133 +0,0 @@
-import requests
-from datetime import datetime
-from app.utils.system import readable_size
-from telebot.formatting import escape_html
-from app import logger
-from config import DISCORD_WEBHOOK_URL
-
-
-def send_webhook(json_data):
- if DISCORD_WEBHOOK_URL:
- result = requests.post(DISCORD_WEBHOOK_URL, json=json_data)
-
- try:
- result.raise_for_status()
- except requests.exceptions.HTTPError as err:
- logger.error(err)
- else:
- logger.debug("Discord payload delivered successfully, code {}.".format(result.status_code))
-
-def report_status_change(username: str, status: str):
- _status = {
- 'active': '**:white_check_mark: Activated**',
- 'disabled': '**:x: Disabled**',
- 'limited': '**:low_battery: #Limited**',
- 'expired': '**:clock5: #Expired**'
- }
- _status_color = {
- 'active': int("9ae6b4", 16),
- 'disabled': int("424b59", 16),
- 'limited': int("f8a7a8", 16),
- 'expired': int("fbd38d", 16)
- }
- statusChange = {
- "content": "",
- "embeds": [
- {
- "description": f"{_status[status]}\n----------------------\n**Username:** {username}",
- "color": _status_color[status]
- }
- ],
- }
- send_webhook(statusChange)
-
-def report_new_user(user_id: int, username: str, by: str, expire_date: int, data_limit: int, proxies: list):
-
- data_limit=readable_size(data_limit) if data_limit else "Unlimited"
- expire_date=datetime.fromtimestamp(expire_date).strftime("%H:%M:%S %Y-%m-%d") if expire_date else "Never"
- proxies="" if not proxies else ", ".join([escape_html(proxy) for proxy in proxies])
-
- reportNewUser = {
- 'content': '',
- 'embeds': [
- {
- "title": ":new: Created",
- "description": f"**Username:** {username}\n**Traffic Limit:** {data_limit}\n**Expire Date:** {expire_date}\n**Proxies:** {proxies}",
- "footer": {
- "text": f"By {by}"
- },
- "color": int("00ff00", 16)
- }
- ]
- }
- send_webhook(reportNewUser)
-
-def report_user_modification(username: str, expire_date: int, data_limit: int, proxies: list, by: str):
-
- data_limit=readable_size(data_limit) if data_limit else "Unlimited"
- expire_date=datetime.fromtimestamp(expire_date).strftime("%H:%M:%S %Y-%m-%d") if expire_date else "Never"
- proxies="" if not proxies else ", ".join([escape_html(proxy) for proxy in proxies])
- protocols = proxies
-
- reportUserModification = {
- 'content': '',
- 'embeds': [
- {
- 'title': ':pencil2: Modified',
- 'description': f'**Username:** {username}\n**Traffic Limit:** {data_limit}\n**Expire Date:** {expire_date}\n**Protocols:** {protocols}',
- 'footer': {
- 'text': f'By {by}'
- },
- 'color': int("00ffff", 16)
- }
- ]
- }
- send_webhook(reportUserModification)
-
-def report_user_deletion(username: str, by: str):
- userDeletion = {
- 'content': '',
- 'embeds': [
- {
- 'title': ':wastebasket: Deleted',
- 'description': f'**Username: **{username}',
- 'footer': {
- 'text': f'By {by}'
- },
- 'color': int("ff0000", 16)
- }
- ]
- }
- send_webhook(userDeletion)
-
-def report_user_usage_reset(username: str, by: str):
- userUsageReset = {
- 'content': '',
- 'embeds': [
- {
- 'title': ':repeat: Reset',
- 'description': f'**Username:** {username}',
- 'footer': {
- 'text': f'By {by}'
- },
- 'color': int('00ffff', 16)
- }
- ]
- }
- send_webhook(userUsageReset)
-
-def report_user_subscription_revoked(username: str, by: str):
- subscriptionRevoked = {
- 'content': '',
- 'embeds': [
- {
- 'title': ':repeat: Revoked',
- 'description': f'**Username:** {username}',
- 'footer': {
- 'text': f'By {by}'
- },
- 'color': int('ff0000', 16)
- }
- ]
- }
- send_webhook(subscriptionRevoked)
diff --git a/app/jobs/0_start_xray.py b/app/jobs/0_start_xray.py
@@ -1,26 +0,0 @@
-import traceback
-import asyncio
-
-from app import app, logger, scheduler, xray
-
-
-async def core_health_check():
- while True:
- if not xray.core.started:
- await xray.core.restart(xray.configs[0].include_db_users(node_id=0))
- await asyncio.sleep(15)
-
-
-@app.on_event("startup")
-async def app_startup():
- logger.info('Starting Xray core')
- try:
- await xray.core.start(xray.configs[0].include_db_users(node_id=0))
- except Exception:
- traceback.print_exc()
- asyncio.get_event_loop().create_task(core_health_check())
-
-
-@app.on_event("shutdown")
-async def app_shutdown():
- await xray.core.stop()
diff --git a/app/jobs/1_start_nodes.py b/app/jobs/1_start_nodes.py
@@ -1,41 +1,54 @@
-import json
+from collections import defaultdict
-from app import app, logger, scheduler, xray
-from app.db import GetDB, crud
+from grpclib import GRPCError
+
+from app import app, scheduler, marznode
+from app.db import GetDB, crud, get_tls_certificate
+from app.marznode import MarzNodeGRPC
from app.models.node import NodeStatus
-from xray_api import exc as xray_exc
+from app.models.proxy import InboundBase
+from app.models.user import UserStatus
async def nodes_health_check():
- for node_id, node in list(xray.nodes.items()):
- if node.started and await node.is_healthy():
- try:
- await node.api.get_sys_stats()
- except (ConnectionError, xray_exc.ConnectionError, xray_exc.UnknownError):
- await xray.operations.restart_node(node_id, xray.configs[node_id].include_db_users(node_id))
-
- if not await node.is_healthy():
- await xray.operations.start_node(node_id, xray.configs[node_id].include_db_users(node_id))
+ with GetDB() as db:
+ for node_id, node in marznode.nodes.items():
+ db_node = crud.get_node_by_id(db, node_id)
+ if await node.is_alive():
+ crud.update_node_status(db, db_node, NodeStatus.healthy)
+ if not node.synced:
+ await sync_node(db, node, node_id)
+ else:
+ crud.update_node_status(db, db_node, NodeStatus.unhealthy)
+
+
+async def sync_node(db, node, node_id):
+ inbounds = await node.fetch_inbounds()
+ crud.assure_node_inbounds(db, inbounds, node_id)
+ relations = crud.get_node_users(db, node_id, [UserStatus.active, UserStatus.on_hold])
+ users = dict()
+ for rel in relations:
+ if not users.get(rel[0]):
+ users[rel[0]] = dict(username=rel[1], id=rel[0], key=rel[2], inbounds=[])
+ users[rel[0]]["inbounds"].append(rel[3].tag)
+ await node.repopulate_users(list(users.values()))
+ node.synced = True
@app.on_event("startup")
-async def app_startup():
+async def nodes_startup():
with GetDB() as db:
- dbnodes = crud.get_nodes(db=db, enabled=True)
- node_ids = [dbnode.id for dbnode in dbnodes]
- for dbnode in dbnodes:
- crud.update_node_status(db, dbnode, NodeStatus.connecting)
-
- for node_id in node_ids:
- await xray.operations.start_node(node_id, xray.configs[node_id].include_db_users(node_id))
-
- scheduler.add_job(nodes_health_check, 'interval', seconds=20, coalesce=True, max_instances=1)
-
-
-@app.on_event("shutdown")
-async def app_shutdown():
- for node in list(xray.nodes.values()):
- try:
- await node.stop()
- except Exception:
- pass
+ certificate = get_tls_certificate(db)
+ db_nodes = crud.get_nodes(db=db, enabled=True)
+ for db_node in db_nodes:
+ node = MarzNodeGRPC(db_node.address, db_node.port,
+ ssl_key=certificate.key, ssl_cert=certificate.certificate)
+ if not await node.is_alive():
+ node.synced = False
+ await marznode.operations.add_node(db_node.id, node)
+ continue
+ await sync_node(db, node, db_node.id)
+ await marznode.operations.add_node(db_node.id, node)
+ # crud.update_node_status(db, db_node, NodeStatus.connecting)
+
+ scheduler.add_job(nodes_health_check, 'interval', seconds=5, coalesce=True, max_instances=1)
diff --git a/app/jobs/record_usages.py b/app/jobs/record_usages.py
@@ -1,202 +0,0 @@
-import asyncio
-from collections import defaultdict
-# from concurrent.futures import ThreadPoolExecutor
-from datetime import datetime
-from operator import attrgetter
-from typing import Union
-
-from pymysql.err import OperationalError
-from sqlalchemy import and_, bindparam, insert, select, sql, update
-
-from app import scheduler, xray
-from app.db import GetDB
-from app.db.models import NodeUsage, NodeUserUsage, System, User
-from config import DISABLE_RECORDING_NODE_USAGE
-from xray_api import XRay as XRayAPI
-from xray_api import exc as xray_exc
-
-
-def safe_execute(db, stmt, params=None):
- if db.bind.name == 'mysql':
- if isinstance(stmt, sql.dml.Insert):
- stmt = stmt.prefix_with('IGNORE')
-
- tries = 0
- done = False
- while not done:
- try:
- db.execute(stmt, params)
- db.commit()
- done = True
- except OperationalError as err:
- if err.args[0] == 1213 and tries < 3: # Deadlock
- db.rollback()
- tries += 1
- continue
- raise err
-
- else:
- db.execute(stmt, params)
- db.commit()
-
-
-def record_user_stats(params: list, node_id: Union[int, None],
- consumption_factor: int = 1):
- if not params:
- return
-
- created_at = datetime.fromisoformat(datetime.utcnow().strftime('%Y-%m-%dT%H:00:00'))
-
- with GetDB() as db:
- # make user usage row if doesn't exist
- select_stmt = select(NodeUserUsage.user_id) \
- .where(and_(NodeUserUsage.node_id == node_id, NodeUserUsage.created_at == created_at))
- existings = [r[0] for r in db.execute(select_stmt).fetchall()]
- uids_to_insert = set()
-
- for p in params:
- uid = int(p['uid'])
- if uid in existings:
- continue
- uids_to_insert.add(uid)
-
- if uids_to_insert:
- stmt = insert(NodeUserUsage).values(
- user_id=bindparam('uid'),
- created_at=created_at,
- node_id=node_id,
- used_traffic=0
- )
- safe_execute(db, stmt, [{'uid': uid} for uid in uids_to_insert])
-
- # record
- stmt = update(NodeUserUsage) \
- .values(used_traffic=NodeUserUsage.used_traffic + bindparam('value') * consumption_factor) \
- .where(and_(NodeUserUsage.user_id == bindparam('uid'),
- NodeUserUsage.node_id == node_id,
- NodeUserUsage.created_at == created_at))
- safe_execute(db, stmt, params)
-
-
-def record_node_stats(params: dict, node_id: Union[int, None]):
- if not params:
- return
-
- created_at = datetime.fromisoformat(datetime.utcnow().strftime('%Y-%m-%dT%H:00:00'))
-
- with GetDB() as db:
-
- # make node usage row if doesn't exist
- select_stmt = select(NodeUsage.node_id). \
- where(and_(NodeUsage.node_id == node_id, NodeUsage.created_at == created_at))
- notfound = db.execute(select_stmt).first() is None
- if notfound:
- stmt = insert(NodeUsage).values(created_at=created_at, node_id=node_id, uplink=0, downlink=0)
- safe_execute(db, stmt)
-
- # record
- stmt = update(NodeUsage). \
- values(uplink=NodeUsage.uplink + bindparam('up'), downlink=NodeUsage.downlink + bindparam('down')). \
- where(and_(NodeUsage.node_id == node_id, NodeUsage.created_at == created_at))
-
- safe_execute(db, stmt, params)
-
-
-async def get_users_stats(api: XRayAPI):
- try:
- params = defaultdict(int)
- for stat in filter(attrgetter('value'), await api.get_users_stats(reset=True)):
- params[stat.name.split('.', 1)[0]] += stat.value
- params = list({"uid": uid, "value": value} for uid, value in params.items())
- return params
- except (xray_exc.ConnectionError, xray_exc.UnknownError):
- return []
-
-
-async def get_outbounds_stats(api: XRayAPI):
- try:
- params = [{"up": stat.value, "down": 0} if stat.link == "uplink" else {"up": 0, "down": stat.value}
- for stat in filter(attrgetter('value'), await api.get_outbounds_stats(reset=True))]
- return params
- except (xray_exc.ConnectionError, xray_exc.UnknownError):
- return []
-
-
-async def record_user_usages():
- api_instances = [(None, xray.api)]
- usage_coefficient = {None: 1} # default usage coefficient for the main api instance
-
- for node_id, node in list(xray.nodes.items()):
- if node.started and await node.is_healthy():
- api_instances.append((node_id, node.api))
- usage_coefficient[node_id] = node.usage_coefficient # fetch the usage coefficient
-
- results = await asyncio.gather(
- *[get_users_stats(api[1]) for api in api_instances]
- )
- api_params = {api_instances[i][0]: results[i] for i in range(len(api_instances))}
-
- users_usage = defaultdict(int)
- for node_id, params in api_params.items():
- coefficient = usage_coefficient.get(node_id, 1) # get the usage coefficient for the node
- for param in params:
- users_usage[param['uid']] += param['value'] * coefficient # apply the usage coefficient
-
- users_usage = list({"uid": uid, "value": value} for uid, value in users_usage.items())
- if not users_usage:
- return
-
- # record users usage
- with GetDB() as db:
- stmt = update(User). \
- where(User.id == bindparam('uid')). \
- values(
- used_traffic=User.used_traffic + bindparam('value'),
- online_at=datetime.utcnow()
- )
-
- safe_execute(db, stmt, users_usage)
-
- if DISABLE_RECORDING_NODE_USAGE:
- return
-
- for node_id, params in api_params.items():
- record_user_stats(params, node_id, usage_coefficient[node_id])
-
-
-async def record_node_usages():
- api_instances = [(None, xray.api)]
- for node_id, node in list(xray.nodes.items()):
- if node.started and await node.is_healthy():
- api_instances.append((node_id, node.api))
- results = await asyncio.gather(
- *[get_outbounds_stats(api[1]) for api in api_instances]
- )
- api_params = {api_instances[i][0]: results[i] for i in range(len(api_instances))}
-
- total_up = 0
- total_down = 0
- for node_id, params in api_params.items():
- for param in params:
- total_up += param['up']
- total_down += param['down']
- if not (total_up or total_down):
- return
-
- # record nodes usage
- with GetDB() as db:
- stmt = update(System).values(
- uplink=System.uplink + total_up,
- downlink=System.downlink + total_down
- )
- safe_execute(db, stmt)
-
- if DISABLE_RECORDING_NODE_USAGE:
- return
-
- for node_id, params in api_params.items():
- record_node_stats(params, node_id)
-
-
-scheduler.add_job(record_user_usages, 'interval', coalesce=True, seconds=30)
-scheduler.add_job(record_node_usages, 'interval', coalesce=True, seconds=10)
diff --git a/app/jobs/reset_user_data_usage.py b/app/jobs/reset_user_data_usage.py
@@ -1,6 +1,6 @@
from datetime import datetime
-from app import logger, scheduler, xray
+from app import logger, scheduler
from app.db import crud, GetDB, get_users
from app.models.user import UserDataLimitResetStrategy, UserStatus
diff --git a/app/jobs/review_users.py b/app/jobs/review_users.py
@@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
from sqlalchemy.orm import Session
-from app import logger, scheduler, xray
+from app import logger, scheduler
from app.db import (GetDB, get_notification_reminder, get_users,
start_user_expire, update_user_status)
from app.models.user import ReminderType, UserResponse, UserStatus
@@ -51,7 +51,7 @@ async def review():
add_notification_reminders(db, user, now)
continue
- await xray.operations.remove_user(user)
+ # await xray.operations.remove_user(user)
update_user_status(db, user, status)
#bg.add_task(
@@ -93,7 +93,7 @@ async def review():
continue
update_user_status(db, user, status)
- await xray.operations.add_user(user)
+ # await xray.operations.add_user(user)
logger.info(f"User \"{user.username}\" status fixed.")
diff --git a/app/marznode/__init__.py b/app/marznode/__init__.py
@@ -0,0 +1,16 @@
+"""stores nodes and provides entities to communicate with the nodes"""
+from typing import Dict
+
+from . import operations
+from .base import MarzNodeBase
+from .grpc import MarzNodeGRPC
+
+nodes: Dict[int, MarzNodeBase] = {}
+
+
+__all__ = [
+ "nodes",
+ "operations",
+ "MarzNodeGRPC",
+ "MarzNodeBase"
+]
diff --git a/app/marznode/base.py b/app/marznode/base.py
@@ -0,0 +1,30 @@
+from abc import ABC
+
+
+class MarzNodeBase(ABC):
+
+ async def fetch_inbounds(self):
+ """returns a list of inbounds on the node"""
+
+ async def add_user(self, user, inbounds: list[str] | None = None) -> None:
+ """adds a user to the node with inbounds specified"""
+
+ async def remove_user(self, user, inbounds: list[str] | None = None) -> None:
+ """removes a user or some inbounds from a user on the node"""
+
+ async def update_user_inbounds(self, user,
+ inbound_additions: list[str] | None = None,
+ inbound_reductions: list[str] | None = None) -> None:
+ """adds some inbounds and removes some inbounds for a user on the node"""
+
+ async def repopulate_users(self, users) -> None:
+ """syncs users with the node"""
+
+ async def fetch_users_stats(self):
+ """get user stats from the node"""
+
+ async def is_alive(self) -> bool:
+ """
+ checks if node is up and running and connected
+ :return: True if the node is responsive, otherwise False
+ """
diff --git a/app/marznode/grpc.py b/app/marznode/grpc.py
@@ -0,0 +1,107 @@
+import atexit
+import ssl
+import tempfile
+
+from grpclib import GRPCError
+from grpclib.client import Channel
+from grpclib.health.v1.health_grpc import HealthStub
+from grpclib.health.v1.health_pb2 import HealthCheckResponse, HealthCheckRequest
+
+from .base import MarzNodeBase
+from .marznode_grpc import MarzServiceStub
+from .marznode_pb2 import UserUpdate, UsersUpdate, Empty, User, Inbound
+
+
+def string_to_temp_file(content: str):
+ file = tempfile.NamedTemporaryFile(mode='w+t')
+ file.write(content)
+ file.flush()
+ return file
+
+
+class MarzNodeGRPC(MarzNodeBase):
+ def __init__(self, address: str, port: int, ssl_key: str, ssl_cert: str): # TODO: implement ssl
+ self._address = address
+ self._port = port
+
+ self._keyfile = string_to_temp_file(ssl_key)
+ self._certfile = string_to_temp_file(ssl_cert)
+
+ ctx = ssl.create_default_context() # cadata=ssl_cert)
+ ctx.load_cert_chain(self._certfile.name, self._keyfile.name)
+ ctx.check_hostname = False
+ ctx.verify_mode = ssl.CERT_NONE
+ self._channel = Channel(self._address, self._port, ssl=ctx)
+ self._stub = MarzServiceStub(self._channel)
+ self._health = HealthStub(self._channel)
+ self.synced = False
+ atexit.register(self._channel.close)
+
+ @staticmethod
+ def catch_connection_problem(func):
+ async def catcher(self, *args, **kwargs):
+ try:
+ await func(self, *args, **kwargs)
+ except (OSError, ConnectionError, GRPCError):
+ self.synced = False
+ return catcher
+
+ @catch_connection_problem
+ async def add_user(self, user, inbounds: list[str] | None = None) -> None:
+ if inbounds is None:
+ inbounds = []
+
+ async with self._stub.AddUser.open() as stm:
+ await stm.send_message(UserUpdate(user=User(id=user.id, username=user.username, key=user.key),
+ inbound_additions=[Inbound(tag=i) for i in inbounds]))
+ await stm.recv_message()
+
+ @catch_connection_problem
+ async def remove_user(self, user, inbounds: list[str] | None = None) -> None:
+ if inbounds is None:
+ inbounds = []
+ async with self._stub.RemoveUser.open() as stm:
+ await stm.send_message(UserUpdate(user=User(id=user.id, username=user.username, key=user.key),
+ inbound_reductions=[Inbound(tag=i) for i in inbounds]))
+ await stm.recv_message()
+
+ @catch_connection_problem
+ async def update_user_inbounds(self, user,
+ inbound_additions: list[str] | None = None,
+ inbound_reductions: list[str] | None = None) -> None:
+ if inbound_reductions is None:
+ inbound_reductions = []
+ if inbound_additions is None:
+ inbound_additions = []
+
+ async with self._stub.UpdateUserInbounds.open() as stm:
+ await stm.send_message(UserUpdate(user=User(id=user.id, username=user.username, key=user.key),
+ inbound_additions=[Inbound(tag=i) for i in inbound_additions],
+ inbound_reductions=[Inbound(tag=i) for i in inbound_reductions]))
+ await stm.recv_message()
+
+ @catch_connection_problem
+ async def repopulate_users(self, user_updates: list[dict]) -> None:
+ async with self._stub.RepopulateUsers.open() as stream:
+ updates = [UserUpdate(user=User(id=u["id"], username=u["username"], key=u["key"]),
+ inbound_additions=[Inbound(tag=t) for t in u["inbounds"]]) for u in user_updates]
+ await stream.send_message(UsersUpdate(users_updates=updates))
+
+ async def fetch_users_stats(self):
+ raise NotImplementedError
+
+ async def fetch_inbounds(self) -> list:
+ async with self._stub.FetchInbounds.open() as stm:
+ await stm.send_message(Empty())
+ inbounds = await stm.recv_message()
+ return inbounds.inbounds
+
+ async def is_alive(self) -> bool:
+ try:
+ response = await self._health.Check(HealthCheckRequest())
+ except (OSError, ConnectionError, GRPCError):
+ pass
+ else:
+ if response.status is HealthCheckResponse.SERVING:
+ return True
+ return False
diff --git a/app/marznode/marznode.proto b/app/marznode/marznode.proto
@@ -0,0 +1,48 @@
+syntax = "proto3";
+
+package marznode;
+
+message Empty {}
+
+message Inbound {
+ string tag = 1;
+ optional string config = 2;
+}
+
+message InboundsResponse {
+ repeated Inbound inbounds = 1;
+}
+
+message User {
+ int32 id = 1;
+ string username = 2;
+ string key = 3;
+}
+
+message UserUpdate {
+ User user = 1;
+ repeated Inbound inbound_additions = 2;
+ repeated Inbound inbound_reductions = 3;
+}
+
+message UsersUpdate {
+ repeated UserUpdate users_updates = 1;
+}
+
+message UsersStats {
+ message UserStats {
+ User user = 1;
+ uint64 uplink = 2;
+ uint64 downlink = 3;
+ }
+ repeated UserStats users_stats = 1;
+}
+
+service MarzService {
+ rpc AddUser(UserUpdate) returns (Empty);
+ rpc RemoveUser(UserUpdate) returns (Empty);
+ rpc UpdateUserInbounds(UserUpdate) returns (Empty);
+ rpc RepopulateUsers(UsersUpdate) returns (Empty);
+ rpc FetchInbounds(Empty) returns (InboundsResponse);
+ rpc FetchUsersStats(Empty) returns (UsersStats);
+}
diff --git a/app/marznode/marznode_grpc.py b/app/marznode/marznode_grpc.py
@@ -0,0 +1,120 @@
+# Generated by the Protocol Buffers compiler. DO NOT EDIT!
+# source: app/marznode/marznode.proto
+# plugin: grpclib.plugin.main
+import abc
+import typing
+
+import grpclib.const
+import grpclib.client
+if typing.TYPE_CHECKING:
+ import grpclib.server
+
+import app.marznode.marznode_pb2
+
+
+class MarzServiceBase(abc.ABC):
+
+ @abc.abstractmethod
+ async def AddUser(self, stream: 'grpclib.server.Stream[app.marznode.marznode_pb2.UserUpdate, app.marznode.marznode_pb2.Empty]') -> None:
+ pass
+
+ @abc.abstractmethod
+ async def RemoveUser(self, stream: 'grpclib.server.Stream[app.marznode.marznode_pb2.UserUpdate, app.marznode.marznode_pb2.Empty]') -> None:
+ pass
+
+ @abc.abstractmethod
+ async def UpdateUserInbounds(self, stream: 'grpclib.server.Stream[app.marznode.marznode_pb2.UserUpdate, app.marznode.marznode_pb2.Empty]') -> None:
+ pass
+
+ @abc.abstractmethod
+ async def RepopulateUsers(self, stream: 'grpclib.server.Stream[app.marznode.marznode_pb2.UsersUpdate, app.marznode.marznode_pb2.Empty]') -> None:
+ pass
+
+ @abc.abstractmethod
+ async def FetchInbounds(self, stream: 'grpclib.server.Stream[app.marznode.marznode_pb2.Empty, app.marznode.marznode_pb2.InboundsResponse]') -> None:
+ pass
+
+ @abc.abstractmethod
+ async def FetchUsersStats(self, stream: 'grpclib.server.Stream[app.marznode.marznode_pb2.Empty, app.marznode.marznode_pb2.UsersStats]') -> None:
+ pass
+
+ def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
+ return {
+ '/marznode.MarzService/AddUser': grpclib.const.Handler(
+ self.AddUser,
+ grpclib.const.Cardinality.UNARY_UNARY,
+ app.marznode.marznode_pb2.UserUpdate,
+ app.marznode.marznode_pb2.Empty,
+ ),
+ '/marznode.MarzService/RemoveUser': grpclib.const.Handler(
+ self.RemoveUser,
+ grpclib.const.Cardinality.UNARY_UNARY,
+ app.marznode.marznode_pb2.UserUpdate,
+ app.marznode.marznode_pb2.Empty,
+ ),
+ '/marznode.MarzService/UpdateUserInbounds': grpclib.const.Handler(
+ self.UpdateUserInbounds,
+ grpclib.const.Cardinality.UNARY_UNARY,
+ app.marznode.marznode_pb2.UserUpdate,
+ app.marznode.marznode_pb2.Empty,
+ ),
+ '/marznode.MarzService/RepopulateUsers': grpclib.const.Handler(
+ self.RepopulateUsers,
+ grpclib.const.Cardinality.UNARY_UNARY,
+ app.marznode.marznode_pb2.UsersUpdate,
+ app.marznode.marznode_pb2.Empty,
+ ),
+ '/marznode.MarzService/FetchInbounds': grpclib.const.Handler(
+ self.FetchInbounds,
+ grpclib.const.Cardinality.UNARY_UNARY,
+ app.marznode.marznode_pb2.Empty,
+ app.marznode.marznode_pb2.InboundsResponse,
+ ),
+ '/marznode.MarzService/FetchUsersStats': grpclib.const.Handler(
+ self.FetchUsersStats,
+ grpclib.const.Cardinality.UNARY_UNARY,
+ app.marznode.marznode_pb2.Empty,
+ app.marznode.marznode_pb2.UsersStats,
+ ),
+ }
+
+
+class MarzServiceStub:
+
+ def __init__(self, channel: grpclib.client.Channel) -> None:
+ self.AddUser = grpclib.client.UnaryUnaryMethod(
+ channel,
+ '/marznode.MarzService/AddUser',
+ app.marznode.marznode_pb2.UserUpdate,
+ app.marznode.marznode_pb2.Empty,
+ )
+ self.RemoveUser = grpclib.client.UnaryUnaryMethod(
+ channel,
+ '/marznode.MarzService/RemoveUser',
+ app.marznode.marznode_pb2.UserUpdate,
+ app.marznode.marznode_pb2.Empty,
+ )
+ self.UpdateUserInbounds = grpclib.client.UnaryUnaryMethod(
+ channel,
+ '/marznode.MarzService/UpdateUserInbounds',
+ app.marznode.marznode_pb2.UserUpdate,
+ app.marznode.marznode_pb2.Empty,
+ )
+ self.RepopulateUsers = grpclib.client.UnaryUnaryMethod(
+ channel,
+ '/marznode.MarzService/RepopulateUsers',
+ app.marznode.marznode_pb2.UsersUpdate,
+ app.marznode.marznode_pb2.Empty,
+ )
+ self.FetchInbounds = grpclib.client.UnaryUnaryMethod(
+ channel,
+ '/marznode.MarzService/FetchInbounds',
+ app.marznode.marznode_pb2.Empty,
+ app.marznode.marznode_pb2.InboundsResponse,
+ )
+ self.FetchUsersStats = grpclib.client.UnaryUnaryMethod(
+ channel,
+ '/marznode.MarzService/FetchUsersStats',
+ app.marznode.marznode_pb2.Empty,
+ app.marznode.marznode_pb2.UsersStats,
+ )
diff --git a/app/marznode/marznode_pb2.py b/app/marznode/marznode_pb2.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler. DO NOT EDIT!
+# source: app/marznode/marznode.proto
+# Protobuf Python Version: 4.25.0
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf.internal import builder as _builder
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x61pp/marznode/marznode.proto\x12\x08marznode\"\x07\n\x05\x45mpty\"6\n\x07Inbound\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x13\n\x06\x63onfig\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_config\"7\n\x10InboundsResponse\x12#\n\x08inbounds\x18\x01 \x03(\x0b\x32\x11.marznode.Inbound\"1\n\x04User\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\"\x87\x01\n\nUserUpdate\x12\x1c\n\x04user\x18\x01 \x01(\x0b\x32\x0e.marznode.User\x12,\n\x11inbound_additions\x18\x02 \x03(\x0b\x32\x11.marznode.Inbound\x12-\n\x12inbound_reductions\x18\x03 \x03(\x0b\x32\x11.marznode.Inbound\":\n\x0bUsersUpdate\x12+\n\rusers_updates\x18\x01 \x03(\x0b\x32\x14.marznode.UserUpdate\"\x8e\x01\n\nUsersStats\x12\x33\n\x0busers_stats\x18\x01 \x03(\x0b\x32\x1e.marznode.UsersStats.UserStats\x1aK\n\tUserStats\x12\x1c\n\x04user\x18\x01 \x01(\x0b\x32\x0e.marznode.User\x12\x0e\n\x06uplink\x18\x02 \x01(\x04\x12\x10\n\x08\x64ownlink\x18\x03 \x01(\x04\x32\xe4\x02\n\x0bMarzService\x12\x30\n\x07\x41\x64\x64User\x12\x14.marznode.UserUpdate\x1a\x0f.marznode.Empty\x12\x33\n\nRemoveUser\x12\x14.marznode.UserUpdate\x1a\x0f.marznode.Empty\x12;\n\x12UpdateUserInbounds\x12\x14.marznode.UserUpdate\x1a\x0f.marznode.Empty\x12\x39\n\x0fRepopulateUsers\x12\x15.marznode.UsersUpdate\x1a\x0f.marznode.Empty\x12<\n\rFetchInbounds\x12\x0f.marznode.Empty\x1a\x1a.marznode.InboundsResponse\x12\x38\n\x0f\x46\x65tchUsersStats\x12\x0f.marznode.Empty\x1a\x14.marznode.UsersStatsb\x06proto3')
+
+_globals = globals()
+_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'app.marznode.marznode_pb2', _globals)
+if _descriptor._USE_C_DESCRIPTORS == False:
+ DESCRIPTOR._options = None
+ _globals['_EMPTY']._serialized_start=41
+ _globals['_EMPTY']._serialized_end=48
+ _globals['_INBOUND']._serialized_start=50
+ _globals['_INBOUND']._serialized_end=104
+ _globals['_INBOUNDSRESPONSE']._serialized_start=106
+ _globals['_INBOUNDSRESPONSE']._serialized_end=161
+ _globals['_USER']._serialized_start=163
+ _globals['_USER']._serialized_end=212
+ _globals['_USERUPDATE']._serialized_start=215
+ _globals['_USERUPDATE']._serialized_end=350
+ _globals['_USERSUPDATE']._serialized_start=352
+ _globals['_USERSUPDATE']._serialized_end=410
+ _globals['_USERSSTATS']._serialized_start=413
+ _globals['_USERSSTATS']._serialized_end=555
+ _globals['_USERSSTATS_USERSTATS']._serialized_start=480
+ _globals['_USERSSTATS_USERSTATS']._serialized_end=555
+ _globals['_MARZSERVICE']._serialized_start=558
+ _globals['_MARZSERVICE']._serialized_end=914
+# @@protoc_insertion_point(module_scope)
diff --git a/app/marznode/operations.py b/app/marznode/operations.py
@@ -0,0 +1,70 @@
+from collections import defaultdict
+from typing import TYPE_CHECKING
+
+from .base import MarzNodeBase
+from app import marznode
+
+if TYPE_CHECKING:
+ from app.db import User as DBUser
+
+
+async def add_user(user: "DBUser"):
+ node_inbounds = defaultdict(list)
+ for inb in user.inbounds:
+ node_inbounds[inb.node_id].append(inb.tag)
+
+ for node_id, tags in node_inbounds.items():
+ await marznode.nodes[node_id].add_user(user=user, inbounds=tags)
+
+
+async def remove_user(user: "DBUser"):
+ nodes_set = set()
+
+ for inb in user.inbounds:
+ nodes_set.add(inb.node_id)
+ print(nodes_set)
+ for n in nodes_set:
+ await marznode.nodes[n].remove_user(user)
+
+
+async def update_user_inbounds(user: "DBUser", new_inbounds: set, old_inbounds: set) -> None:
+ """
+ updates user inbounds by finding out inbound additions and reductions
+ it then calculates all inbound additions and reductions for each node separately,
+ and then sends requests to affected nodes
+ :param user: the user
+ :param new_inbounds: a set of all the new inbounds
+ :param old_inbounds: a set of all the old inbounds
+ :return: nothing
+ """
+ inbound_additions = new_inbounds - old_inbounds
+ inbound_reductions = old_inbounds - new_inbounds
+
+ node_inbounds = defaultdict(lambda: tuple((list(), list())))
+
+ for inbound_addition in inbound_additions:
+ node_inbounds[inbound_addition[0]][0].append(inbound_addition[3])
+ for inbound_reduction in inbound_reductions:
+ node_inbounds[inbound_reduction[0]][1].append(inbound_reduction[3])
+
+ for node, inbound_change in node_inbounds.items():
+ await marznode.nodes[node].update_user_inbounds(user, inbound_change[0], inbound_change[1])
+
+
+async def remove_node(node_id: int):
+ if node_id in marznode.nodes:
+ del marznode.nodes[node_id]
+
+
+async def add_node(node_id: int, node: MarzNodeBase):
+ await remove_node(node_id)
+ marznode.nodes[node_id] = node
+
+
+__all__ = [
+ "add_user",
+ "remove_user",
+ "update_user_inbounds",
+ "add_node",
+ "remove_node"
+]
diff --git a/app/models/core.py b/app/models/core.py
@@ -1,7 +0,0 @@
-from pydantic import BaseModel
-
-
-class CoreStats(BaseModel):
- version: str
- started: bool
- logs_websocket: str
diff --git a/app/models/node.py b/app/models/node.py
@@ -5,9 +5,8 @@ from pydantic import ConfigDict, BaseModel, Field
class NodeStatus(str, Enum):
- connected = "connected"
- connecting = "connecting"
- error = "error"
+ healthy = "healthy"
+ unhealthy = "unhealthy"
disabled = "disabled"
@@ -17,16 +16,17 @@ class NodeSettings(BaseModel):
class NodeBase(BaseModel):
- id: int
+ id: Optional[int] = Field(None)
name: str
address: str
port: int = 62050
- api_port: int = 62051
- usage_coefficient: float = Field(gt=0, default=1.0)
+ usage_coefficient: float = Field(ge=0, default=1.0)
model_config = ConfigDict(from_attributes=True)
+
from app.models.proxy import InboundBase
+
class Node(NodeBase):
inbounds: Optional[List[InboundBase]] = None
@@ -37,20 +37,17 @@ class NodeCreate(Node):
"name": "DE node",
"address": "192.168.1.1",
"port": 62050,
- "api_port": 62051,
- "add_as_new_host": True,
"usage_coefficient": 1
}
})
class NodeModify(Node):
- name: Optional[str] = Field(None, nullable=True)
- address: Optional[str] = Field(None, nullable=True)
- port: Optional[int] = Field(None, nullable=True)
- api_port: Optional[int] = Field(None, nullable=True)
- status: Optional[NodeStatus] = Field(None, nullable=True)
- usage_coefficient: Optional[float] = Field(None, nullable=True)
+ name: Optional[str] = Field(None)
+ address: Optional[str] = Field(None)
+ port: Optional[int] = Field(None)
+ status: Optional[NodeStatus] = Field(None)
+ usage_coefficient: Optional[float] = Field(None)
model_config = ConfigDict(json_schema_extra={
"example": {
"name": "DE node",
diff --git a/app/models/proxy.py b/app/models/proxy.py
@@ -6,15 +6,15 @@ from typing import Optional, Union, List
from pydantic import ConfigDict, BaseModel, Field, validator
-# from app.utils.system import random_password
-from xray_api.types.account import (
- ShadowsocksAccount,
- ShadowsocksMethods,
- TrojanAccount,
- VLESSAccount,
- VMessAccount,
- XTLSFlows,
-)
+class XTLSFlows(Enum):
+ NONE = ''
+ VISION = 'xtls-rprx-vision'
+
+
+class ShadowsocksMethods(Enum):
+ AES_128_GCM = 'aes-128-gcm'
+ AES_256_GCM = 'aes-256-gcm'
+ CHACHA20_POLY1305 = 'chacha20-ietf-poly1305'
class ProxyTypes(str, Enum):
@@ -25,17 +25,6 @@ class ProxyTypes(str, Enum):
Trojan = "trojan"
Shadowsocks = "shadowsocks"
- @property
- def account_model(self):
- if self == self.VMess:
- return VMessAccount
- if self == self.VLESS:
- return VLESSAccount
- if self == self.Trojan:
- return TrojanAccount
- if self == self.Shadowsocks:
- return ShadowsocksAccount
-
@property
def settings_model(self):
if self == self.VMess:
@@ -63,24 +52,20 @@ class VMessSettings(ProxySettings):
id: str = Field(nullable=False)
-
class VLESSSettings(ProxySettings):
id: str = Field(nullable=False)
flow: XTLSFlows = XTLSFlows.NONE
-
class TrojanSettings(ProxySettings):
password: str = Field(nullable=False)
-
class ShadowsocksSettings(ProxySettings):
password: str = Field(nullable=False)
method: ShadowsocksMethods = ShadowsocksMethods.CHACHA20_POLY1305
-
class InboundHostSecurity(str, Enum):
inbound_default = "inbound_default"
none = "none"
@@ -178,9 +163,11 @@ class InboundBase(BaseModel):
node_id: Optional[int] = Field(None)
model_config = ConfigDict(from_attributes=True)
+
from app.models.service import ServiceBase
from app.models.node import NodeBase
+
class Inbound(InboundBase):
services: Optional[List[ServiceBase]] = None
node: Optional[NodeBase] = None
diff --git a/app/models/user.py b/app/models/user.py
@@ -1,16 +1,13 @@
import re
+import secrets
from datetime import datetime
from enum import Enum
-from typing import Dict, List, Optional, Union
-import random
-import secrets
+from typing import List, Optional, Union
from pydantic import field_validator, ConfigDict, BaseModel, Field, validator, computed_field, ValidationInfo
-from app import xray
-from app.models.proxy import ProxySettings, ProxyTypes, InboundBase
+from app.models.proxy import InboundBase
from app.utils.jwt import create_subscription_token
-
from config import XRAY_SUBSCRIPTION_PATH, XRAY_SUBSCRIPTION_URL_PREFIX
USERNAME_REGEXP = re.compile(r"^(?=\w{3,32}\b)[a-zA-Z0-9-_@.]+(?:_[a-zA-Z0-9-_@.]+)*$")
@@ -28,8 +25,10 @@ class UserStatus(str, Enum):
expired = "expired"
on_hold = "on_hold"
+
from app.utils.share import generate_v2ray_links
+
class UserStatusModify(str, Enum):
active = "active"
disabled = "disabled"
@@ -190,13 +189,12 @@ class UserResponse(User):
def service_ids(self) -> List[int]:
return [s.id for s in self.services]
-
@computed_field
@property
def links(self) -> List[str]:
- return generate_v2ray_links(
- inbounds=self.inbounds, key=self.key, extra_data=self.dict(exclude={'subscription_url', 'links'})
- )
+ return [""]# generate_v2ray_links(
+ # inbounds=self.inbounds, key=self.key, extra_data=self.dict(exclude={'subscription_url', 'links'})
+ # )
@computed_field
@property
diff --git a/app/telegram/handlers/admin.py b/app/telegram/handlers/admin.py
@@ -13,7 +13,6 @@ from telebot import types
from telebot.util import user_link
from telebot.asyncio_handler_backends import State, StatesGroup
-from app import xray
from app.db import GetDB, crud
from app.models.user import (UserCreate, UserModify, UserResponse, UserStatus,
UserStatusModify)
diff --git a/app/telegram/utils/keyboard.py b/app/telegram/utils/keyboard.py
@@ -4,7 +4,6 @@ from typing import Literal, Dict, List
from telebot import types # noqa
-from app import xray
from app.utils.system import readable_size
diff --git a/app/utils/crypto.py b/app/utils/crypto.py
@@ -1,3 +1,5 @@
+import ssl
+
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from OpenSSL import crypto
@@ -31,3 +33,15 @@ def generate_certificate():
"cert": cert_pem,
"key": key_pem
}
+
+
+def create_secure_context(
+ client_cert: str, client_key: str, trusted: str,
+) -> ssl.SSLContext:
+ ctx = ssl.create_default_context(cafile=trusted)
+ ctx.load_cert_chain(client_cert, client_key)
+ ctx.set_ciphers('ECDHE+AESGCM:ECDHE+CHACHA20:DHE+AESGCM:DHE+CHACHA20')
+ ctx.set_alpn_protocols(['h2'])
+ ctx.check_hostname = False
+ ctx.verify_mode = ssl.CERT_NONE
+ return ctx
diff --git a/app/utils/report.py b/app/utils/report.py
@@ -12,7 +12,6 @@ from app.utils.notification import (Notification, ReachedDaysLeft,
UserDisabled, UserEnabled, UserExpired,
UserLimited, UserSubscriptionRevoked,
UserUpdated, notify)
-from app import discord
async def status_change(username: str, status: UserStatus, user: UserResponse, by: Optional[Admin] = None) -> None:
@@ -28,10 +27,6 @@ async def status_change(username: str, status: UserStatus, user: UserResponse, b
await notify(UserDisabled(username=username, action=Notification.Type.user_disabled, user=user, by=by))
elif status == UserStatus.active:
await notify(UserEnabled(username=username, action=Notification.Type.user_enabled, user=user, by=by))
- try:
- await discord.report_status_change(username, status)
- except Exception:
- pass
async def user_created(user: UserResponse, user_id: int, by: Admin) -> None:
@@ -46,17 +41,6 @@ async def user_created(user: UserResponse, user_id: int, by: Admin) -> None:
)
await notify(UserCreated(username=user.username, action=Notification.Type.user_created, by=by, user=user))
- try:
- await discord.report_new_user(
- user_id=user_id,
- username=user.username,
- by=by.username,
- expire_date=user.expire,
- data_limit=user.data_limit,
- services=user.services
- )
- except Exception:
- pass
async def user_updated(user: UserResponse, by: Admin) -> None:
@@ -71,16 +55,6 @@ async def user_updated(user: UserResponse, by: Admin) -> None:
except Exception:
pass
await notify(UserUpdated(username=user.username, action=Notification.Type.user_updated, by=by, user=user))
- try:
- await discord.report_user_modification(
- username=user.username,
- expire_date=user.expire,
- data_limit=user.data_limit,
- services=user.services,
- by=by.username,
- )
- except Exception:
- pass
async def user_deleted(username: str, by: Admin) -> None:
@@ -89,10 +63,6 @@ async def user_deleted(username: str, by: Admin) -> None:
except Exception:
pass
await notify(UserDeleted(username=username, action=Notification.Type.user_deleted, by=by))
- try:
- discord.report_user_deletion(username=username, by=by.username)
- except Exception:
- pass
async def user_data_usage_reset(user: UserResponse, by: Admin) -> None:
@@ -104,13 +74,6 @@ async def user_data_usage_reset(user: UserResponse, by: Admin) -> None:
except Exception:
pass
await notify(UserDataUsageReset(username=user.username, action=Notification.Type.data_usage_reset, by=by, user=user))
- try:
- await discord.report_user_usage_reset(
- username=user.username,
- by=by.username,
- )
- except Exception:
- pass
async def user_subscription_revoked(user: UserResponse, by: Admin) -> None:
@@ -122,13 +85,6 @@ async def user_subscription_revoked(user: UserResponse, by: Admin) -> None:
except Exception:
pass
await notify(UserSubscriptionRevoked(username=user.username, action=Notification.Type.subscription_revoked, by=by, user=user))
- try:
- await discord.report_user_subscription_revoked(
- username=user.username,
- by=by.username,
- )
- except Exception:
- pass
async def data_usage_percent_reached(
diff --git a/app/utils/share.py b/app/utils/share.py
@@ -6,12 +6,10 @@ import urllib.parse as urlparse
from datetime import datetime as dt, timedelta
from typing import TYPE_CHECKING, Literal, Union, List
from uuid import UUID
-import traceback
import yaml
from jdatetime import date as jd
-from app import xray
from app.models.proxy import FormatVariables, InboundBase, InboundHost, InboundHostSecurity
from app.templates import render_template
from app.utils.system import get_public_ip, readable_size
diff --git a/app/views/__init__.py b/app/views/__init__.py
@@ -1,9 +1,7 @@
from .admin import *
from .subscription import *
from .system import *
-from .core import *
from .user import *
-#from .user_template import *
from .service import *
from .node import *
from .home import *
diff --git a/app/views/core.py b/app/views/core.py
@@ -1,115 +0,0 @@
-import asyncio
-import json
-# import time
-
-import commentjson
-from fastapi import Depends, HTTPException, WebSocket
-from starlette.websockets import WebSocketDisconnect
-from websockets.exceptions import ConnectionClosedError
-
-from app import app, xray
-from app.db import Session, get_db
-from app.models.admin import Admin
-from app.models.core import CoreStats
-from app.xray import XRayConfig
-from config import XRAY_JSON
-from anyio import create_memory_object_stream, run
-
-
-@app.websocket("/api/core/logs")
-async def core_logs(websocket: WebSocket, db: Session = Depends(get_db)):
- token = (
- websocket.query_params.get('token')
- or
- websocket.headers.get('Authorization', '').removeprefix("Bearer ")
- )
- admin = Admin.get_admin(token, db)
- if not admin:
- return await websocket.close(reason="Unauthorized", code=4401)
-
- if not admin.is_sudo:
- return await websocket.close(reason="You're not allowed", code=4403)
-
- interval = websocket.query_params.get('interval')
- if interval:
- try:
- interval = float(interval)
- except ValueError:
- return await websocket.close(reason="Invalid interval value", code=4400)
- if interval > 10:
- return await websocket.close(reason="Interval must be more than 0 and at most 10 seconds", code=4400)
-
- await websocket.accept()
-
- try:
- buffer = xray.core.get_buffer()
- while buffer:
- await websocket.send_text(buffer.popleft().decode("utf-8"))
- rcv_stm = await xray.core.get_logs_stm()
- while l := await rcv_stm.receive():
- l = l.decode("utf-8")
- await websocket.send_text(l)
- except (WebSocketDisconnect, RuntimeError, ConnectionClosedError):
- pass
- except asyncio.CancelledError:
- await websocket.close()
- finally:
- await rcv_stm.aclose()
-
-
-@app.get("/api/core", tags=["Core"], response_model=CoreStats)
-def get_core_stats(admin: Admin = Depends(Admin.get_current)):
- return CoreStats(
- version=xray.core.version,
- started=xray.core.started,
- logs_websocket=app.url_path_for('core_logs')
- )
-
-
-@app.post("/api/core/restart", tags=["Core"])
-async def restart_core(admin: Admin = Depends(Admin.get_current)):
- if not admin.is_sudo:
- raise HTTPException(status_code=403, detail="You're not allowed")
-
- startup_config = xray.config.include_db_users()
- await xray.core.restart(startup_config)
- for node_id, node in list(xray.nodes.items()):
- if await node.is_healthy():
- await xray.operations.restart_node(node_id, startup_config)
- return {}
-
-
-@app.get("/api/core/config", tags=["Core"])
-def get_core_config(admin: Admin = Depends(Admin.get_current)) -> dict:
- if not admin.is_sudo:
- raise HTTPException(status_code=403, detail="You're not allowed")
-
- with open(XRAY_JSON, "r") as f:
- config = commentjson.loads(f.read())
-
- return config
-
-
-@app.put("/api/core/config", tags=["Core"])
-async def modify_core_config(payload: dict, admin: Admin = Depends(Admin.get_current)) -> dict:
- if not admin.is_sudo:
- raise HTTPException(status_code=403, detail="You're not allowed")
-
- try:
- config = XRayConfig(payload, api_port=xray.config.api_port)
- except ValueError as err:
- raise HTTPException(status_code=400, detail=str(err))
-
- xray.config = config
- with open(XRAY_JSON, 'w') as f:
- f.write(json.dumps(payload, indent=4))
-
- startup_config = xray.config.include_db_users()
- await xray.core.restart(startup_config)
- for node_id, node in list(xray.nodes.items()):
- if await node.is_healthy():
- await xray.operations.restart_node(node_id, startup_config)
-
- xray.hosts.update()
-
- return payload
diff --git a/app/views/node.py b/app/views/node.py
@@ -5,14 +5,14 @@ from typing import List
import sqlalchemy
from fastapi import BackgroundTasks, Depends, HTTPException, WebSocket
-from starlette.websockets import WebSocketDisconnect
-from app import app, logger, xray
-from app.db import Session, crud, get_db
+
+from app import app, logger, marznode
+from app.db import Session, crud, get_db, get_tls_certificate
+from app.marznode import MarzNodeGRPC
from app.models.admin import Admin
from app.models.node import (NodeCreate, NodeModify, NodeResponse,
NodeSettings, NodeStatus, NodesUsageResponse)
-from app.models.proxy import InboundHost
@app.get("/api/node/settings", tags=['Node'], response_model=NodeSettings)
@@ -30,37 +30,26 @@ def get_node_settings(db: Session = Depends(get_db),
@app.post("/api/node", tags=['Node'], response_model=NodeResponse)
async def add_node(new_node: NodeCreate,
- bg: BackgroundTasks,
- db: Session = Depends(get_db),
- admin: Admin = Depends(Admin.get_current)):
+ db: Session = Depends(get_db),
+ admin: Admin = Depends(Admin.get_current)):
if not admin.is_sudo:
raise HTTPException(status_code=403, detail="You're not allowed")
try:
- dbnode = crud.create_node(db, new_node)
+ db_node = crud.create_node(db, new_node)
except sqlalchemy.exc.IntegrityError:
db.rollback()
raise HTTPException(status_code=409, detail=f"Node \"{new_node.name}\" already exists")
+ certificate = get_tls_certificate(db)
- asyncio.get_running_loop().create_task(
- xray.operations.start_node(
- node_id=dbnode.id,
- config=xray.config.include_db_users())
- )
+ node = MarzNodeGRPC(db_node.address, db_node.port,
+ ssl_key=certificate.key, ssl_cert=certificate.certificate)
- if new_node.add_as_new_host is True:
- host = InboundHost(
- remark=(new_node.name + " ({USERNAME}) [{PROTOCOL} - {TRANSPORT}]"),
- address=new_node.address
- )
- for inbound_tag in xray.config.inbounds_by_tag:
- crud.add_host(db, inbound_tag, host)
+ await marznode.operations.add_node(db_node.id, node)
- xray.hosts.update()
-
- logger.info(f"New node \"{dbnode.name}\" added")
- return dbnode
+ logger.info(f"New node \"{db_node.name}\" added")
+ return db_node
@app.get("/api/node/{node_id}", tags=['Node'], response_model=NodeResponse)
@@ -91,7 +80,7 @@ async def node_logs(node_id: int, websocket: WebSocket, db: Session = Depends(ge
if not admin.is_sudo:
return await websocket.close(reason="You're not allowed", code=4403)
- if not xray.nodes.get(node_id):
+ if not marznode.nodes.get(node_id):
return await websocket.close(reason="Node not found", code=4404)
if not await xray.nodes[node_id].is_healthy():
@@ -109,38 +98,6 @@ async def node_logs(node_id: int, websocket: WebSocket, db: Session = Depends(ge
await websocket.accept()
async for l in xray.nodes[node_id].get_logs():
await websocket.send_text(l)
- """
- cache = ''
- last_sent_ts = 0
- with xray.nodes[node_id].get_logs() as logs:
- while True:
- if interval and time.time() - last_sent_ts >= interval and cache:
- try:
- await websocket.send_text(cache)
- except (WebSocketDisconnect, RuntimeError):
- break
- cache = ''
- last_sent_ts = time.time()
-
- if not logs:
- try:
- await asyncio.wait_for(websocket.receive(), timeout=0.2)
- continue
- except asyncio.TimeoutError:
- continue
- except (WebSocketDisconnect, RuntimeError):
- break
-
- log = logs.popleft()
-
- if interval:
- cache += f'{log}\n'
- continue
-
- try:
- await websocket.send_text(log)
- except (WebSocketDisconnect, RuntimeError):
- break"""
@app.get("/api/nodes", tags=['Node'], response_model=List[NodeResponse])
@@ -153,50 +110,42 @@ def get_nodes(db: Session = Depends(get_db),
@app.put("/api/node/{node_id}", tags=['Node'], response_model=NodeResponse)
async def modify_node(node_id: int,
- modified_node: NodeModify,
- bg: BackgroundTasks,
- db: Session = Depends(get_db),
- admin: Admin = Depends(Admin.get_current)):
+ modified_node: NodeModify,
+ db: Session = Depends(get_db),
+ admin: Admin = Depends(Admin.get_current)):
if not admin.is_sudo:
raise HTTPException(status_code=403, detail="You're not allowed")
- dbnode = crud.get_node_by_id(db, node_id)
- if not dbnode:
+ db_node = crud.get_node_by_id(db, node_id)
+ if not db_node:
raise HTTPException(status_code=404, detail="Node not found")
- dbnode = crud.update_node(db, dbnode, modified_node)
+ db_node = crud.update_node(db, db_node, modified_node)
- await xray.operations.remove_node(dbnode.id)
- if dbnode.status != NodeStatus.disabled:
- asyncio.get_running_loop().create_task(
- xray.operations.start_node(
- node_id=dbnode.id,
- config=xray.config.include_db_users()
- ))
+ await marznode.operations.remove_node(db_node.id)
+ if db_node.status != NodeStatus.disabled:
+ certificate = get_tls_certificate(db)
+ node = MarzNodeGRPC(db_node.address, db_node.port,
+ ssl_key=certificate.key, ssl_cert=certificate.certificate)
+ await marznode.operations.add_node(db_node.id, node)
- logger.info(f"Node \"{dbnode.name}\" modified")
- return dbnode
+ logger.info(f"Node \"{db_node.name}\" modified")
+ return db_node
-@app.post("/api/node/{node_id}/reconnect", tags=['Node'])
+@app.post("/api/node/{node_id}/resync", tags=['Node'])
async def reconnect_node(node_id: int,
- bg: BackgroundTasks,
- db: Session = Depends(get_db),
- admin: Admin = Depends(Admin.get_current)):
+ db: Session = Depends(get_db),
+ admin: Admin = Depends(Admin.get_current)):
if not admin.is_sudo:
raise HTTPException(status_code=403, detail="You're not allowed")
- dbnode = crud.get_node_by_id(db, node_id)
- if not dbnode:
+ db_node = crud.get_node_by_id(db, node_id)
+ if not db_node:
raise HTTPException(status_code=404, detail="Node not found")
- asyncio.get_running_loop().create_task(
- xray.operations.start_node(
- node_id=dbnode.id,
- config=xray.config.include_db_users())
- )
return {}
@@ -208,14 +157,14 @@ async def remove_node(node_id: int,
if not admin.is_sudo:
raise HTTPException(status_code=403, detail="You're not allowed")
- dbnode = crud.get_node_by_id(db, node_id)
- if not dbnode:
+ db_node = crud.get_node_by_id(db, node_id)
+ if not db_node:
raise HTTPException(status_code=404, detail="Node not found")
- crud.remove_node(db, dbnode)
- await xray.operations.remove_node(dbnode.id)
+ crud.remove_node(db, db_node)
+ await marznode.operations.remove_node(db_node.id)
- logger.info(f"Node \"{dbnode.name}\" deleted")
+ logger.info(f"Node \"{db_node.name}\" deleted")
return {}
diff --git a/app/views/system.py b/app/views/system.py
@@ -2,7 +2,7 @@ from typing import Dict, List, Union
from fastapi import Depends, HTTPException
-from app import app, xray
+from app import app
from app.db import Session, crud, get_db
from app.models.admin import Admin
from app.models.proxy import InboundHost, Inbound, ProxyTypes, InboundBase
diff --git a/app/views/user.py b/app/views/user.py
@@ -5,7 +5,7 @@ import asyncio
import sqlalchemy
from fastapi import BackgroundTasks, Depends, HTTPException, Query
-from app import app, logger, xray
+from app import app, logger, marznode
from app.db import Session, crud, get_db
from app.models.admin import Admin
from app.models.user import (UserCreate, UserModify, UserResponse,
@@ -36,8 +36,8 @@ async def add_user(new_user: UserCreate,
raise HTTPException(status_code=409, detail="User already exists")
user = UserResponse.model_validate(dbuser)
- asyncio.get_running_loop().create_task(xray.operations.add_user(user=user))
- asyncio.get_running_loop().create_task(
+ await marznode.operations.add_user(user=dbuser)
+ asyncio.create_task(
report.user_created(
user=user,
user_id=dbuser.id,
@@ -77,10 +77,10 @@ async def modify_user(username: str,
- **proxies** dictionary of protocol:settings, empty means no change
- **inbounds** dictionary of protocol:inbound_tags, empty means no change
"""
+ dbuser = crud.get_user(db, username)
if not (admin.is_sudo or (dbuser.admin and dbuser.admin.username == admin.username)):
raise HTTPException(status_code=403, detail="You're not allowed")
- dbuser = crud.get_user(db, username)
if not dbuser:
raise HTTPException(status_code=404, detail="User not found")
old_inbounds = {(i.node_id, i.protocol, i.tag) for i in dbuser.inbounds}
@@ -90,11 +90,11 @@ async def modify_user(username: str,
user = UserResponse.model_validate(dbuser)
if user.status in [UserStatus.active, UserStatus.on_hold]:
- asyncio.get_running_loop().create_task(xray.operations.update_user(
+ asyncio.create_task(marznode.operations.update_user(
user=new_user, new_inbounds=new_inbounds, old_inbounds=old_inbounds)
)
else:
- asyncio.get_running_loop().create_task(xray.operations.remove_user(dbuser))
+ asyncio.create_task(marznode.operations.remove_user(dbuser))
asyncio.get_running_loop().create_task(report.user_updated(
user=user,
@@ -121,22 +121,19 @@ async def remove_user(username: str,
"""
Remove a user
"""
+ dbuser = crud.get_user(db, username)
if not (admin.is_sudo or (dbuser.admin and dbuser.admin.username == admin.username)):
raise HTTPException(status_code=403, detail="You're not allowed")
- dbuser = crud.get_user(db, username)
if not dbuser:
raise HTTPException(status_code=404, detail="User not found")
- await xray.operations.remove_user(dbuser)
+ await marznode.operations.remove_user(dbuser)
- # db.expunge(dbuser)
crud.remove_user(db, dbuser)
db.flush()
-
- # asyncio.get_running_loop().create_task(xray.operations.remove_user(dbuser))
-
- asyncio.get_running_loop().create_task(
+
+ asyncio.create_task(
report.user_deleted(
username=dbuser.username,
by=admin
@@ -161,10 +158,10 @@ async def reset_user_data_usage(username: str,
dbuser = crud.reset_user_data_usage(db=db, dbuser=dbuser)
if dbuser.status in [UserStatus.active, UserStatus.on_hold]:
- asyncio.get_running_loop().create_task(xray.operations.add_user(dbuser=dbuser))
+ asyncio.create_task(marznode.operations.add_user(dbuser=dbuser))
user = UserResponse.model_validate(dbuser)
- asyncio.get_running_loop().create_task(report.user_data_usage_reset(
+ asyncio.create_task(report.user_data_usage_reset(
user=user,
by=admin))
@@ -306,7 +303,7 @@ def set_owner(username: str,
dbuser = crud.set_owner(db, dbuser, new_admin)
user = UserResponse.model_validate(dbuser)
- logger.info(f"{user.username}\"owner successfully set to{admin.username}")
+ logger.info(f"{user.username}'s owner successfully set to {admin.username}")
return user
diff --git a/app/xray/__init__.py b/app/xray/__init__.py
@@ -1,82 +0,0 @@
-from random import randint
-from typing import TYPE_CHECKING, Dict, Sequence
-
-from app.models.proxy import InboundHostSecurity
-from app.utils.store import DictStorage
-from app.utils.system import check_port
-from app.xray import operations
-from app.xray.config import XRayConfig
-from app.xray.core import XRayCore
-from app.xray.node import XRayNode
-from config import XRAY_ASSETS_PATH, XRAY_EXECUTABLE_PATH, XRAY_JSON
-from xray_api import XRay as XRayAPI
-from xray_api import exceptions
-from xray_api import exceptions as exc
-from xray_api import types
-
-
-core = XRayCore(XRAY_EXECUTABLE_PATH, XRAY_ASSETS_PATH)
-configs: Dict[int, XRayConfig] = {}
-
-# Search for a free API port
-try:
- for api_port in range(randint(10000, 60000), 65536):
- if not check_port(api_port):
- break
-finally:
- configs[0] = XRayConfig(XRAY_JSON, api_port=api_port)
- del api_port
-
-api = XRayAPI(configs[0].api_host, configs[0].api_port)
-
-nodes: Dict[int, XRayNode] = {}
-
-
-if TYPE_CHECKING:
- from app.db.models import InboundHost
-
-"""
-@DictStorage
-def hosts(storage: dict):
- from app.db import GetDB, crud
-
- storage.clear()
- with GetDB() as db:
- for inbound_id, node_id in config.inbounds_by_id:
- inbound_hosts: Sequence[InboundHost] = crud.get_hosts(db, inbound_)
-
- storage[inbound_tag] = [
- {
- "remark": host.remark,
- "address": host.address,
- "port": host.port,
- "path": host.path if host.path else None,
- "sni": [i.strip() for i in host.sni.split(',')] if host.sni else [],
- "host": [i.strip() for i in host.host.split(',')] if host.host else [],
- "alpn": host.alpn.value,
- "fingerprint": host.fingerprint.value,
- # None means the tls is not specified by host itself and
- # complies with its inbound's settings.
- "tls": None
- if host.security == InboundHostSecurity.inbound_default
- else host.security.value,
- "allowinsecure":host.allowinsecure,
- } for host in inbound_hosts if not host.is_disabled
- ]
-
-"""
-
-__all__ = [
- "configs",
- "hosts",
- "core",
- "api",
- "nodes",
- "operations",
- "exceptions",
- "exc",
- "types",
- "XRayConfig",
- "XRayCore",
- "XRayNode",
-]
diff --git a/app/xray/config.py b/app/xray/config.py
@@ -1,345 +0,0 @@
-from __future__ import annotations
-
-import json
-from copy import deepcopy
-from pathlib import PosixPath
-from typing import Union, Optional
-
-import commentjson
-
-from app.db import GetDB, crud
-#from app.db.models import Inbound
-from app.models.proxy import ProxyTypes, InboundBase
-from app.models.user import UserStatus
-from app.utils.crypto import get_cert_SANs
-from app.utils.keygen import generate_settings
-from config import DEBUG, XRAY_EXCLUDE_INBOUND_TAGS, XRAY_FALLBACKS_INBOUND_TAG
-
-class XRayConfig(dict):
- def __init__(self,
- config: Union[dict, str, PosixPath] = {},
- api_host: str = "127.0.0.1",
- api_port: int = 8080):
- if isinstance(config, str):
- try:
- # considering string as json
- config = commentjson.loads(config)
- except (json.JSONDecodeError, ValueError):
- # considering string as file path
- with open(config, 'r') as file:
- config = commentjson.loads(file.read())
-
- if isinstance(config, PosixPath):
- with open(config, 'r') as file:
- config = commentjson.loads(file.read())
-
- if isinstance(config, dict):
- config = deepcopy(config)
-
- self.api_host = api_host
- self.api_port = api_port
-
- super().__init__(config)
- self._validate()
-
- self.inbounds = []
- self.inbounds_by_protocol = {}
- self.inbounds_by_tag = {}
- self._fallbacks_inbound = self.get_inbound(XRAY_FALLBACKS_INBOUND_TAG)
- self._addr_clients_by_tag = {}
- self._resolve_inbounds()
-
- self._apply_api()
-
- def _apply_api(self):
- api_inbound = self.get_inbound("API_INBOUND")
- if api_inbound:
- api_inbound["listen"] = self.api_host
- api_inbound["listen"]["address"] = self.api_host
- api_inbound["port"] = self.api_port
- return
-
- self["api"] = {
- "services": [
- "HandlerService",
- "StatsService",
- "LoggerService"
- ],
- "tag": "API"
- }
- self["stats"] = {}
- self["policy"] = {
- "levels": {
- "0": {
- "statsUserUplink": True,
- "statsUserDownlink": True
- }
- },
- "system": {
- "statsInboundDownlink": False,
- "statsInboundUplink": False,
- "statsOutboundDownlink": True,
- "statsOutboundUplink": True
- }
- }
- inbound = {
- "listen": self.api_host,
- "port": self.api_port,
- "protocol": "dokodemo-door",
- "settings": {
- "address": self.api_host
- },
- "tag": "API_INBOUND"
- }
- try:
- self["inbounds"].insert(0, inbound)
- except KeyError:
- self["inbounds"] = []
- self["inbounds"].insert(0, inbound)
-
- rule = {
- "inboundTag": [
- "API_INBOUND"
- ],
- "outboundTag": "API",
- "type": "field"
- }
- try:
- self["routing"]["rules"].insert(0, rule)
- except KeyError:
- self["routing"] = {"rules": []}
- self["routing"]["rules"].insert(0, rule)
-
- def _validate(self):
- if not self.get("inbounds"):
- raise ValueError("config doesn't have inbounds")
-
- if not self.get("outbounds"):
- raise ValueError("config doesn't have outbounds")
-
- for inbound in self['inbounds']:
- if not inbound.get("tag"):
- raise ValueError("all inbounds must have a unique tag")
- for outbound in self['outbounds']:
- if not outbound.get("tag"):
- raise ValueError("all outbounds must have a unique tag")
-
- def _resolve_inbounds(self):
- for inbound in self['inbounds']:
- if not inbound['protocol'] in ProxyTypes._value2member_map_:
- continue
-
- if inbound['tag'] in XRAY_EXCLUDE_INBOUND_TAGS:
- continue
-
- if not inbound.get('settings'):
- inbound['settings'] = {}
- if not inbound['settings'].get('clients'):
- inbound['settings']['clients'] = []
- self._addr_clients_by_tag[inbound['tag']
- ] = inbound['settings']['clients']
-
- settings = {
- "tag": inbound["tag"],
- "protocol": inbound["protocol"],
- "port": None,
- "network": "tcp",
- "tls": 'none',
- "sni": [],
- "host": [],
- "path": "",
- "header_type": "",
- "is_fallback": False
- }
-
- # port settings
- try:
- settings['port'] = inbound['port']
- except KeyError:
- if not self._fallbacks_inbound:
- raise ValueError(
- f"port missing on {inbound['tag']}"
- "\nset XRAY_FALLBACKS_INBOUND_TAG if you're using an inbound containing fallbacks"
- )
- try:
- settings['port'] = self._fallbacks_inbound['port']
- settings['is_fallback'] = True
- except KeyError:
- raise ValueError("fallbacks inbound doesn't have port")
-
- # stream settings
- if stream := inbound.get('streamSettings'):
- net = stream.get('network', 'tcp')
- net_settings = stream.get(f"{net}Settings", {})
- security = stream.get("security")
- tls_settings = stream.get(f"{security}Settings")
-
- if settings['is_fallback'] is True:
- # probably this is a fallback
- security = self._fallbacks_inbound.get(
- 'streamSettings', {}).get('security')
- tls_settings = self._fallbacks_inbound.get(
- 'streamSettings', {}).get(f"{security}Settings", {})
-
- settings['network'] = net
-
- if security == 'tls':
- # settings['fp']
- # settings['alpn']
- settings['tls'] = 'tls'
- for certificate in tls_settings.get('certificates', []):
-
- if certificate.get("certificateFile", None):
- with open(certificate['certificateFile'], 'rb') as file:
- cert = file.read()
- settings['sni'].extend(get_cert_SANs(cert))
-
- if certificate.get("certificate", None):
- cert = certificate['certificate']
- if isinstance(cert, list):
- cert = '\n'.join(cert)
- if isinstance(cert, str):
- cert = cert.encode()
- settings['sni'].extend(get_cert_SANs(cert))
-
- elif security == 'reality':
- settings['fp'] = 'chrome'
- settings['tls'] = 'reality'
- settings['sni'] = tls_settings.get('serverNames', [])
-
- try:
- settings['pbk'] = tls_settings['publicKey']
- except KeyError:
- pvk = tls_settings.get('privateKey')
- if not pvk:
- raise ValueError(
- f"You need to provide privateKey in realitySettings of {inbound['tag']}")
-
- try:
- from app.xray import core
- x25519 = core.get_x25519(pvk)
- settings['pbk'] = x25519['public_key']
- except ImportError:
- pass
-
- if not settings.get('pbk'):
- raise ValueError(
- f"You need to provide publicKey in realitySettings of {inbound['tag']}")
-
- try:
- settings['sid'] = tls_settings.get('shortIds')[0]
- except (IndexError, TypeError):
- raise ValueError(
- f"You need to define at least one shortID in realitySettings of {inbound['tag']}")
-
- if net == 'tcp':
- header = net_settings.get('header', {})
- request = header.get('request', {})
- path = request.get('path')
- host = request.get('headers', {}).get('Host')
-
- settings['header_type'] = header.get('type', '')
-
- if isinstance(path, str) or isinstance(host, str):
- raise ValueError(f"Settings of {inbound['tag']} for path and host must be list, not str\n"
- "https://xtls.github.io/config/transports/tcp.html#httpheaderobject")
-
- if path and isinstance(path, list):
- settings['path'] = path[0]
-
- if host and isinstance(host, list):
- settings['host'] = host
-
- elif net == 'ws':
- path = net_settings.get('path', '')
- host = net_settings.get('headers', {}).get('Host')
-
- settings['header_type'] = ''
-
- if isinstance(path, list) or isinstance(host, list):
- raise ValueError(f"Settings of {inbound['tag']} for path and host must be str, not list\n"
- "https://xtls.github.io/config/transports/websocket.html#websocketobject")
-
- if isinstance(path, str):
- settings['path'] = path
-
- if isinstance(host, str):
- settings['host'] = [host]
-
- elif net == 'grpc':
- settings['header_type'] = ''
- settings['path'] = net_settings.get('serviceName', '')
- settings['host'] = []
-
- else:
- settings['path'] = net_settings.get('path', '')
- host = net_settings.get(
- 'host', {}) or net_settings.get('Host', {})
- if host and isinstance(host, list):
- settings['host'] = host[0]
- elif host and isinstance(host, str):
- settings['host'] = host
-
- self.inbounds.append(settings)
- self.inbounds_by_tag[inbound['tag']] = settings
-
- try:
- self.inbounds_by_protocol[inbound['protocol']].append(settings)
- except KeyError:
- self.inbounds_by_protocol[inbound['protocol']] = [settings]
-
- def add_inbound_client(self, inbound_tag: str, email: str, settings: dict):
- inbound = self.inbounds_by_tag.get(inbound_tag, {})
- client = {"email": email, **settings}
-
- # XTLS currently only supports transmission methods of TCP and mKCP
- if client.get('flow') and (
- inbound.get('network', 'tcp') not in ('tcp', 'kcp')
- or
- (
- inbound.get('network', 'tcp') in ('tcp', 'kcp')
- and
- inbound.get('tls') not in ('tls', 'reality')
- )
- or
- inbound.get('header_type') == 'http'
- ):
- del client['flow']
-
- try:
- self._addr_clients_by_tag[inbound_tag].append(client)
- except KeyError:
- return
- return client
-
- def get_inbound(self, tag) -> dict:
- for inbound in self['inbounds']:
- if inbound['tag'] == tag:
- return inbound
-
- def get_outbound(self, tag) -> dict:
- for outbound in self['outbounds']:
- if outbound['tag'] == tag:
- return outbound
-
- def to_json(self, **json_kwargs):
- return json.dumps(self, **json_kwargs)
-
- def copy(self):
- return deepcopy(self)
-
- def include_db_users(self, node_id: int) -> XRayConfig:
- config = self.copy()
-
- with GetDB() as db:
- inbounds = [InboundBase(protocol=i["protocol"], tag=i["tag"]) for i in self.inbounds]
- crud.assure_node_inbounds(db,
- inbounds=inbounds, node_id=node_id)
- for user_id, username, user_key, inbound_protocol, inbound_tag in crud.get_node_users(db, statuses=[UserStatus.active,
- UserStatus.on_hold], node_id=node_id):
- config.add_inbound_client(inbound_tag, f"{user_id}.{username}", generate_settings(user_key, inbound_protocol))
- if DEBUG:
- with open('generated_config-debug.json', 'w') as f:
- f.write(config.to_json(indent=4))
-
- return config
diff --git a/app/xray/core.py b/app/xray/core.py
@@ -1,151 +0,0 @@
-import asyncio
-import atexit
-import re
-import subprocess
-import threading
-from collections import deque
-from contextlib import contextmanager
-from anyio import create_memory_object_stream, run, ClosedResourceError, BrokenResourceError
-
-from app import logger
-from app.xray.config import XRayConfig
-from config import DEBUG
-
-
-class XRayCore:
- def __init__(self,
- executable_path: str = "/usr/bin/xray",
- assets_path: str = "/usr/share/xray"):
- self.executable_path = executable_path
- self.assets_path = assets_path
-
- self.version = self.get_version()
- self.process = None
- self.restarting = False
-
- self._snd_stms, self._rcv_stms = [], []
- self._logs_buffer = deque(maxlen=100)
- self._on_start_funcs = []
- self._on_stop_funcs = []
- self._env = {
- "XRAY_LOCATION_ASSET": assets_path
- }
-
- atexit.register(lambda: self.stop() if self.started else None)
-
- async def aget_version(self):
- cmd = [self.executable_path, "version"]
- p = await asyncio.create_subprocess_shell(" ".join(cmd), stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.STDOUT)
- stdout = (await p.communicate())[0]
- return m.groups()[0] if (m := re.match(r'^Xray (\d+\.\d+\.\d+)', stdout.decode("utf-8"))) else None
-
- def get_version(self):
- return asyncio.get_event_loop().run_until_complete(self.aget_version())
-
- async def aget_x25519(self, private_key: str = None):
- cmd = [self.executable_path, "x25519"]
- if private_key:
- cmd.extend(['-i', private_key])
- p = await asyncio.create_subprocess_shell(" ".join(cmd), stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.STDOUT)
- stdout = (await p.communicate())[0]
- if m := re.match(r'Private key: (.+)\nPublic key: (.+)', stdout.decode()):
- private, public = m.groups()
- return {
- "private_key": private,
- "public_key": public
- }
-
- def get_x25519(self, private_key: str = None):
- # just calls the same function in a blocking way
- return asyncio.get_event_loop().run_until_complete(self.aget_x25519(private_key))
-
- async def __capture_process_logs(self):
- # capture the logs, push it into the stream, and store it in the deck
- # note that the stream blocks sending if it's full, so a deck is necessary
- try:
- while output := (await self.process.stdout.readline()):
- # self._logs_buffer.append(output)
- for stm in self._snd_stms:
- try:
- await stm.send(output)
- except (ClosedResourceError, BrokenResourceError):
- self._snd_stms.remove(stm)
- continue
- except Exception as e:
- print(e, type(e), flush=True)
-
- async def get_logs_stm(self):
- new_snd_stm, new_rcv_stm = create_memory_object_stream()
- self._snd_stms.append(new_snd_stm)
- return new_rcv_stm
-
- def get_buffer(self):
- # makes a copy of the buffer, so it could be read multiple times
- # the buffer is never cleared in case logs from xray's exit are useful
- return self._logs_buffer.copy()
-
- @property
- def started(self):
- if not self.process:
- return False
-
- if self.process.returncode is None:
- return True
-
- return False
-
- async def start(self, config: XRayConfig):
- if self.started is True:
- raise RuntimeError("Xray is started already")
-
- if config.get('log', {}).get('logLevel') in ('none', 'error'):
- config['log']['logLevel'] = 'warning'
-
- cmd = [
- self.executable_path,
- "run",
- '-config',
- 'stdin:'
- ]
- self.process = await asyncio.create_subprocess_shell(
- " ".join(cmd),
- env=self._env,
- stdin=asyncio.subprocess.PIPE,
- stderr=asyncio.subprocess.PIPE,
- stdout=asyncio.subprocess.PIPE
- )
- self.process.stdin.write(str.encode(config.to_json()))
- await self.process.stdin.drain()
- self.process.stdin.close()
- await self.process.stdin.wait_closed()
- logger.warning(f"Xray core {self.version} started")
-
- asyncio.get_event_loop().create_task(self.__capture_process_logs())
-
- async def stop(self):
- if not self.started:
- return
-
- self.process.terminate()
- self.process = None
- logger.warning("Xray core stopped")
-
- async def restart(self, config: XRayConfig):
- if self.restarting is True:
- return
-
- try:
- self.restarting = True
- logger.warning("Restarting Xray core...")
- await self.stop()
- await self.start(config)
- finally:
- self.restarting = False
-
- def on_start(self, func: callable):
- self._on_start_funcs.append(func)
- return func
-
- def on_stop(self, func: callable):
- self._on_stop_funcs.append(func)
- return func
diff --git a/app/xray/node.py b/app/xray/node.py
@@ -1,164 +0,0 @@
-import re
-import ssl
-import tempfile
-# import time
-from contextlib import contextmanager
-from typing import List
-
-from grpclib.health.v1.health_pb2 import HealthCheckRequest, HealthCheckResponse
-from grpclib.health.v1.health_grpc import HealthStub
-from grpclib.exceptions import GRPCError
-from grpclib.client import Channel
-from mnode.service_pb2 import XrayFetchVersionRequest, XrayStartRequest, XrayStopRequest, XrayRestartRequest, XrayFetchVersionRequest
-from mnode.service_grpc import XrayServiceStub
-
-from app.xray.config import XRayConfig
-from xray_api import XRay as XRayAPI
-
-
-def string_to_temp_file(content: str):
- file = tempfile.NamedTemporaryFile(mode='w+t')
- file.write(content)
- file.flush()
- return file
-
-
-class XRayNode:
-
- def __init__(self,
- address: str,
- port: int,
- api_port: int,
- ssl_key: str,
- ssl_cert: str,
- usage_coefficient: float = 1):
-
- self.address = address
- self.port = port
- self.api_port = api_port
- self.ssl_key = ssl_key
- self.ssl_cert = ssl_cert
- self.usage_coefficient = usage_coefficient
-
- self.started = False
-
- self._keyfile = string_to_temp_file(ssl_key)
- self._certfile = string_to_temp_file(ssl_cert)
-
- ctx = ssl.create_default_context()# cadata=ssl_cert)
- ctx.load_cert_chain(self._certfile.name, self._keyfile.name)
- ctx.check_hostname = False
- ctx.verify_mode = ssl.CERT_NONE
- self._channel = Channel(self.address, self.port, ssl=ctx)
- self._stub = XrayServiceStub(self._channel)
- self._health = HealthStub(self._channel)
- # self._service = Service()
- self._api = None
-
- async def is_healthy(self):
- try:
- response = await self._health.Check(HealthCheckRequest())
- except (ConnectionError, GRPCError):
- pass
- else:
- if response.status is HealthCheckResponse.SERVING:
- return True
- return False
-
- @property
- def api(self):
- return self._api
-
- def _prepare_config(self, config: XRayConfig):
- for inbound in config.get("inbounds", []):
- streamSettings = inbound.get("streamSettings") or {}
- tlsSettings = streamSettings.get("tlsSettings") or {}
- certificates = tlsSettings.get("certificates") or []
- for certificate in certificates:
- if certificate.get("certificateFile"):
- with open(certificate['certificateFile']) as file:
- certificate['certificate'] = [
- line.strip() for line in file.readlines()
- ]
- del certificate['certificateFile']
-
- if certificate.get("keyFile"):
- with open(certificate['keyFile']) as file:
- certificate['key'] = [
- line.strip() for line in file.readlines()
- ]
- del certificate['keyFile']
-
- return config
-
- async def fetch_xray_version(self):
- async with self._stub.XrayFetchVersion.open() as stm:
- await stm.send_message(XrayFetchVersionRequest())
- r = await stm.recv_message()
- return r.version
-
- async def start(self, config: XRayConfig):
- config = self._prepare_config(config)
-
- json_config = config.to_json()
- async with self._stub.XrayStart.open() as stm:
- await stm.send_message(XrayStartRequest(config=json_config))
- r = await stm.recv_message()
- if r.success is True or r.already_started is True:
- self.started = True
- self._node_cert = ssl.get_server_certificate((self.address, self.port))
- self._node_certfile = string_to_temp_file(self._node_cert)
- # connect to API
- self._api = XRayAPI(
- address=self.address,
- port=self.api_port,
- ssl_cert=self._node_cert,
- ssl_target_name="Gozargah"
- )
- """try:
- grpc.channel_ready_future(self._api._channel).result(timeout=5)
- except grpc.FutureTimeoutError:
-
- start_time = time.time()
- end_time = start_time + 3 # check logs for 3 seconds
- last_log = ''
- with self.get_logs() as logs:
- while time.time() < end_time:
- if logs:
- last_log = logs[-1].strip().split('n')[-1]
- time.sleep(0.1)
-
- self.disconnect()
-
- if re.search(r'[Ff]ailed', last_log):
- raise RuntimeError(last_log)
-
- raise ConnectionError('Failed to connect to node's API')"""
-
- async def stop(self):
- async with self._stub.XrayStop.open() as stm:
- await stm.send_message(XrayStopRequest())
- await stm.recv_message()
- # self.remote.stop()
- self.started = False
- self._api = None
-
- async def restart(self, config: XRayConfig):
- self.started = False
- config = self._prepare_config(config)
- json_config = config.to_json()
- async with self._stub.XrayRestart.open() as stm:
- await stm.send_message(XrayRestartRequest(config=json_config))
- r = await stm.recv_message()
- if r.success is True:
- self.started = True
-
- @contextmanager
- async def get_logs(self):
- if not self.connected:
- raise ConnectionError("Node is not connected")
- async with self._stub.XrayFetchLogs.open() as stm:
- await stm.send_message(XrayFetchLogsRequest())
- async for l in stm:
- yield l
-
diff --git a/app/xray/operations.py b/app/xray/operations.py
@@ -1,292 +0,0 @@
-from functools import lru_cache
-from typing import TYPE_CHECKING
-import traceback
-
-from sqlalchemy.exc import SQLAlchemyError
-
-from app import logger, xray
-from app.db import GetDB, crud
-from app.models.node import NodeStatus
-from app.models.user import UserResponse
-from app.utils.keygen import generate_settings
-from app.xray.node import XRayNode
-from xray_api import XRay as XRayAPI
-from xray_api.types.account import Account, XTLSFlows
-
-if TYPE_CHECKING:
- from app.db import User as DBUser
- from app.db.models import Node as DBNode
-
-
-@lru_cache(maxsize=None)
-def get_tls():
- from app.db import GetDB, get_tls_certificate
- with GetDB() as db:
- tls = get_tls_certificate(db)
- return {
- "key": tls.key,
- "certificate": tls.certificate
- }
-
-
-async def _add_user_to_inbound(api: XRayAPI, inbound_tag: str, account: Account):
- logger.debug(f"adding user {account.email} to inbound {inbound_tag}")
- try:
- await api.add_inbound_user(tag=inbound_tag, user=account)
- except (xray.exc.EmailExistsError, xray.exc.ConnectionError):
- pass
-
-
-async def _remove_user_from_inbound(api: XRayAPI, inbound_tag: str, email: str):
- logger.debug(f"removing user {email} from inbound {inbound_tag}")
- try:
- await api.remove_inbound_user(tag=inbound_tag, email=email)
- except (xray.exc.EmailNotFoundError, xray.exc.ConnectionError):
- pass
-
-
-async def _alter_inbound_user(api: XRayAPI, inbound_tag: str, account: Account):
- try:
- await api.remove_inbound_user(tag=inbound_tag, email=account.email)
- except (xray.exc.EmailNotFoundError, xray.exc.ConnectionError):
- pass
- try:
- await api.add_inbound_user(tag=inbound_tag, user=account)
- except (xray.exc.EmailExistsError, xray.exc.ConnectionError):
- pass
-
-
-async def add_user(user: "DBUser"):
- email, key = f"{user.id}.{user.username}", user.key
-
- for inb in user.inbounds:
- proxy_type, tag = inb.protocol, inb.tag
- # for inbound_tag in inbound_tags:
- # inbound = xray.config.inbounds_by_tag.get(inbound_tag, {})
-
- proxy_settings = generate_settings(key, proxy_type)# user.proxies[proxy_type].dict(no_obj=True)
-
- account = proxy_type.account_model(email=email, **proxy_settings)
-
- # XTLS currently only supports transmission methods of TCP and mKCP TODO
- """
- if getattr(account, 'flow', None) and (
- inbound.get('network', 'tcp') not in ('tcp', 'kcp')
- or
- (
- inbound.get('network', 'tcp') in ('tcp', 'kcp')
- and
- inbound.get('tls') not in ('tls', 'reality')
- )
- or
- inbound.get('header_type') == 'http'
- ):
- account.flow = XTLSFlows.NONE
- """
- if inb.node_id == 0:
- await _add_user_to_inbound(xray.api, tag, account) # main core
- else:
- node = xray.nodes[inb.node_id]
- if await node.is_healthy():
- await _add_user_to_inbound(node.api, tag, account)
- #for node in list(xray.nodes.values()):
- # if await node.is_healthy():
- # await _add_user_to_inbound(node.api, tag, account)
-
-
-async def remove_user(dbuser: "DBUser"):
- email = f"{dbuser.id}.{dbuser.username}"
-
- for inb in dbuser.inbounds:
- if inb.node_id == 0:
- await _remove_user_from_inbound(xray.api, inb.tag, email)
- else:
- await _remove_user_from_inbound(xray.nodes[node_id].api, inb.tag, email)
- #for node in list(xray.nodes.values()):
- # if await node.is_healthy():
- # await _remove_user_from_inbound(node.api, inb.tag, email)
- """
- for inbound_tag in xray.config.inbounds_by_tag:
- await _remove_user_from_inbound(xray.api, inbound_tag, email)
- for node in list(xray.nodes.values()):
- if await node.is_healthy():
- await _remove_user_from_inbound(node.api, inbound_tag, email)
- """
-
-async def update_user(user: "DBUser", new_inbounds: set, old_inbounds: set):
- # user = UserResponse.model_validate(dbuser)
- email = f"{user.id}.{user.username}"
- key = user.key
- activated_inbounds = new_inbounds - old_inbounds
- disabled_inbounds = old_inbounds - new_inbounds
-
- for node_id, protocol, tag in activated_inbounds:
- account = protocol.account_model(email=email, **generate_settings(key, protocol))
- if node_id == 0:
- await _add_user_to_inbound(xray.api, tag, account)
- else:
- node = xray.nodes[node_id]
- if await node.is_healthy():
- await _add_user_to_inbound(node.api, tag, account)
-
- for node_id, protocol, tag in disabled_inbounds:
- if node_id == 0:
- await _remove_user_from_inbound(xray.api, tag, email)
- else:
- node = xray.nodes[node_id]
- if await node.is_healthy():
- await _remove_user_from_inbound(node.api, tag, email)
- """
- active_inbounds = []
- for proxy_type, inbound_tags in user.inbounds.items():
- for inbound_tag in inbound_tags:
- active_inbounds.append(inbound_tag)
- inbound = xray.config.inbounds_by_tag.get(inbound_tag, {})
-
- try:
- proxy_settings = user.proxies[proxy_type].dict(no_obj=True)
- except KeyError:
- pass
- account = proxy_type.account_model(email=email, **proxy_settings)
-
- # XTLS currently only supports transmission methods of TCP and mKCP
- if getattr(account, 'flow', None) and (
- inbound.get('network', 'tcp') not in ('tcp', 'kcp')
- or
- (
- inbound.get('network', 'tcp') in ('tcp', 'kcp')
- and
- inbound.get('tls') not in ('tls', 'reality')
- )
- or
- inbound.get('header_type') == 'http'
- ):
- account.flow = XTLSFlows.NONE
-
- await _alter_inbound_user(xray.api, inbound_tag, account) # main core
- for node in list(xray.nodes.values()):
- if await node.is_healthy():
- await _alter_inbound_user(node.api, inbound_tag, account)
-
- for inbound_tag in xray.config.inbounds_by_tag:
- if inbound_tag in active_inbounds:
- continue
- # remove disabled inbounds
- await _remove_user_from_inbound(xray.api, inbound_tag, email)
- for node in list(xray.nodes.values()):
- if await node.is_healthy():
- await _remove_user_from_inbound(node.api, inbound_tag, email)"""
-
-
-async def remove_node(node_id: int):
- if node_id in xray.nodes:
- try:
- await xray.nodes[node_id].stop()
- except Exception:
- pass
- finally:
- del xray.nodes[node_id]
-
-
-async def add_node(dbnode: "DBNode"):
- await remove_node(dbnode.id)
-
- tls = get_tls()
- xray.nodes[dbnode.id] = XRayNode(address=dbnode.address,
- port=dbnode.port,
- api_port=dbnode.api_port,
- ssl_key=tls['key'],
- ssl_cert=tls['certificate'],
- usage_coefficient=dbnode.usage_coefficient)
-
- return xray.nodes[dbnode.id]
-
-
-def _change_node_status(node_id: int, status: NodeStatus, message: str = None, version: str = None):
- with GetDB() as db:
- try:
- dbnode = crud.get_node_by_id(db, node_id)
- if not dbnode:
- return
- crud.update_node_status(db, dbnode, status, message, version)
- except SQLAlchemyError:
- db.rollback()
-
-
-# @threaded_function
-async def start_node(node_id, config):
- with GetDB() as db:
- dbnode = crud.get_node_by_id(db, node_id)
-
- if not dbnode:
- return
-
- try:
- node = xray.nodes[dbnode.id]
- assert await node.is_healthy()
- except (KeyError, AssertionError):
- node = await xray.operations.add_node(dbnode)
-
- try:
- _change_node_status(node_id, NodeStatus.connecting)
- logger.info(f"Starting \"{dbnode.name}\" node")
- await node.start(config)
- version = await node.fetch_xray_version()
- _change_node_status(node_id, NodeStatus.connected, version=version)
- logger.info(f"Started \"{dbnode.name}\" node, xray run on v{version}")
- except Exception as e:
- _change_node_status(node_id, NodeStatus.error, message=str(e))
- logger.info(f"Unable to Start \"{dbnode.name}\" node")
-
-
-# @threaded_function
-async def restart_node(node_id, config):
- with GetDB() as db:
- dbnode = crud.get_node_by_id(db, node_id)
-
- if not dbnode:
- return
-
- try:
- node = xray.nodes[dbnode.id]
- except KeyError:
- node = xray.operations.add_node(dbnode)
-
- if not await node.is_healthy():
- return await start_node(node_id, config)
-
- if not node.started:
- try:
- logger.info(f"Starting Xray core of \"{dbnode.name}\" node")
- await node.start(config)
- logger.info(f"Xray core of \"{dbnode.name}\" node started")
- except Exception as e:
- _change_node_status(node_id, NodeStatus.error, message=str(e))
- logger.info(f"Unable to start node {node_id}")
- try:
- node.disconnect()
- except Exception:
- pass
- return
-
- try:
- logger.info(f"Restarting Xray core of \"{dbnode.name}\" node")
- await node.restart(config)
- logger.info(f"Xray core of \"{dbnode.name}\" node restarted")
- except Exception as e:
- _change_node_status(node_id, NodeStatus.error, message=str(e))
- logger.info(f"Unable to restart node {node_id}")
- try:
- node.disconnect()
- except Exception:
- pass
-
-
-__all__ = [
- "add_user",
- "remove_user",
- "add_node",
- "remove_node",
- "connect_node",
- "restart_node",
-]
diff --git a/main.py b/main.py
@@ -14,12 +14,10 @@ from uvicorn import Config, Server
import logging
if __name__ == "__main__":
- # Do NOT change workers count for now
- # multi-workers support isn't implemented yet for APScheduler and XRay module
loop = asyncio.new_event_loop()
try:
cfg = Config(
- app = app,
+ app=app,
host=('0.0.0.0' if DEBUG else UVICORN_HOST),
port=UVICORN_PORT,
uds=(None if DEBUG else UVICORN_UDS),
@@ -28,7 +26,6 @@ if __name__ == "__main__":
workers=1,
reload=DEBUG,
log_level=logging.DEBUG if DEBUG else logging.INFO,
- loop=loop
)
server = Server(cfg)
loop.run_until_complete(server.serve())
diff --git a/mnode/service_grpc.py b/mnode/service_grpc.py
@@ -1,104 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: service.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import mnode.service_pb2 as service_pb2
-
-
-class XrayServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def XrayStart(self, stream: 'grpclib.server.Stream[service_pb2.XrayStartRequest, service_pb2.XrayStartResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def XrayRestart(self, stream: 'grpclib.server.Stream[service_pb2.XrayRestartRequest, service_pb2.XrayRestartResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def XrayStop(self, stream: 'grpclib.server.Stream[service_pb2.XrayStopRequest, service_pb2.XrayStopResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def XrayFetchVersion(self, stream: 'grpclib.server.Stream[service_pb2.XrayFetchVersionRequest, service_pb2.XrayFetchVersionResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def XrayLogsStream(self, stream: 'grpclib.server.Stream[service_pb2.XrayLogsRequest, service_pb2.XrayLogsResponse]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/mnode.XrayService/XrayStart': grpclib.const.Handler(
- self.XrayStart,
- grpclib.const.Cardinality.UNARY_UNARY,
- service_pb2.XrayStartRequest,
- service_pb2.XrayStartResponse,
- ),
- '/mnode.XrayService/XrayRestart': grpclib.const.Handler(
- self.XrayRestart,
- grpclib.const.Cardinality.UNARY_UNARY,
- service_pb2.XrayRestartRequest,
- service_pb2.XrayRestartResponse,
- ),
- '/mnode.XrayService/XrayStop': grpclib.const.Handler(
- self.XrayStop,
- grpclib.const.Cardinality.UNARY_UNARY,
- service_pb2.XrayStopRequest,
- service_pb2.XrayStopResponse,
- ),
- '/mnode.XrayService/XrayFetchVersion': grpclib.const.Handler(
- self.XrayFetchVersion,
- grpclib.const.Cardinality.UNARY_UNARY,
- service_pb2.XrayFetchVersionRequest,
- service_pb2.XrayFetchVersionResponse,
- ),
- '/mnode.XrayService/XrayLogsStream': grpclib.const.Handler(
- self.XrayLogsStream,
- grpclib.const.Cardinality.UNARY_STREAM,
- service_pb2.XrayLogsRequest,
- service_pb2.XrayLogsResponse,
- ),
- }
-
-
-class XrayServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.XrayStart = grpclib.client.UnaryUnaryMethod(
- channel,
- '/mnode.XrayService/XrayStart',
- service_pb2.XrayStartRequest,
- service_pb2.XrayStartResponse,
- )
- self.XrayRestart = grpclib.client.UnaryUnaryMethod(
- channel,
- '/mnode.XrayService/XrayRestart',
- service_pb2.XrayRestartRequest,
- service_pb2.XrayRestartResponse,
- )
- self.XrayStop = grpclib.client.UnaryUnaryMethod(
- channel,
- '/mnode.XrayService/XrayStop',
- service_pb2.XrayStopRequest,
- service_pb2.XrayStopResponse,
- )
- self.XrayFetchVersion = grpclib.client.UnaryUnaryMethod(
- channel,
- '/mnode.XrayService/XrayFetchVersion',
- service_pb2.XrayFetchVersionRequest,
- service_pb2.XrayFetchVersionResponse,
- )
- self.XrayLogsStream = grpclib.client.UnaryStreamMethod(
- channel,
- '/mnode.XrayService/XrayLogsStream',
- service_pb2.XrayLogsRequest,
- service_pb2.XrayLogsResponse,
- )
diff --git a/mnode/service_pb2.py b/mnode/service_pb2.py
@@ -1,127 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: service.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rservice.proto\x12\x05mnode\"\"\n\x10XrayStartRequest\x12\x0e\n\x06\x63onfig\x18\x01 \x01(\t\"\x86\x01\n\x11XrayStartResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x1c\n\x0f\x61lready_started\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x12\n\x10_already_startedB\x11\n\x0f_failure_reason\"$\n\x12XrayRestartRequest\x12\x0e\n\x06\x63onfig\x18\x01 \x01(\t\"\x80\x01\n\x13XrayRestartResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x18\n\x0bnot_started\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x1b\n\x0e\x66\x61ilure_reason\x18\x03 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0c_not_startedB\x11\n\x0f_failure_reason\"\x11\n\x0fXrayStopRequest\"\x12\n\x10XrayStopResponse\"\x19\n\x17XrayFetchVersionRequest\"+\n\x18XrayFetchVersionResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\"\x11\n\x0fXrayLogsRequest\" \n\x10XrayLogsResponse\x12\x0c\n\x04line\x18\x01 \x01(\t2\xea\x02\n\x0bXrayService\x12>\n\tXrayStart\x12\x17.mnode.XrayStartRequest\x1a\x18.mnode.XrayStartResponse\x12\x44\n\x0bXrayRestart\x12\x19.mnode.XrayRestartRequest\x1a\x1a.mnode.XrayRestartResponse\x12;\n\x08XrayStop\x12\x16.mnode.XrayStopRequest\x1a\x17.mnode.XrayStopResponse\x12S\n\x10XrayFetchVersion\x12\x1e.mnode.XrayFetchVersionRequest\x1a\x1f.mnode.XrayFetchVersionResponse\x12\x43\n\x0eXrayLogsStream\x12\x16.mnode.XrayLogsRequest\x1a\x17.mnode.XrayLogsResponse0\x01\x62\x06proto3')
-
-
-
-_XRAYSTARTREQUEST = DESCRIPTOR.message_types_by_name['XrayStartRequest']
-_XRAYSTARTRESPONSE = DESCRIPTOR.message_types_by_name['XrayStartResponse']
-_XRAYRESTARTREQUEST = DESCRIPTOR.message_types_by_name['XrayRestartRequest']
-_XRAYRESTARTRESPONSE = DESCRIPTOR.message_types_by_name['XrayRestartResponse']
-_XRAYSTOPREQUEST = DESCRIPTOR.message_types_by_name['XrayStopRequest']
-_XRAYSTOPRESPONSE = DESCRIPTOR.message_types_by_name['XrayStopResponse']
-_XRAYFETCHVERSIONREQUEST = DESCRIPTOR.message_types_by_name['XrayFetchVersionRequest']
-_XRAYFETCHVERSIONRESPONSE = DESCRIPTOR.message_types_by_name['XrayFetchVersionResponse']
-_XRAYLOGSREQUEST = DESCRIPTOR.message_types_by_name['XrayLogsRequest']
-_XRAYLOGSRESPONSE = DESCRIPTOR.message_types_by_name['XrayLogsResponse']
-XrayStartRequest = _reflection.GeneratedProtocolMessageType('XrayStartRequest', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYSTARTREQUEST,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayStartRequest)
- })
-_sym_db.RegisterMessage(XrayStartRequest)
-
-XrayStartResponse = _reflection.GeneratedProtocolMessageType('XrayStartResponse', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYSTARTRESPONSE,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayStartResponse)
- })
-_sym_db.RegisterMessage(XrayStartResponse)
-
-XrayRestartRequest = _reflection.GeneratedProtocolMessageType('XrayRestartRequest', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYRESTARTREQUEST,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayRestartRequest)
- })
-_sym_db.RegisterMessage(XrayRestartRequest)
-
-XrayRestartResponse = _reflection.GeneratedProtocolMessageType('XrayRestartResponse', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYRESTARTRESPONSE,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayRestartResponse)
- })
-_sym_db.RegisterMessage(XrayRestartResponse)
-
-XrayStopRequest = _reflection.GeneratedProtocolMessageType('XrayStopRequest', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYSTOPREQUEST,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayStopRequest)
- })
-_sym_db.RegisterMessage(XrayStopRequest)
-
-XrayStopResponse = _reflection.GeneratedProtocolMessageType('XrayStopResponse', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYSTOPRESPONSE,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayStopResponse)
- })
-_sym_db.RegisterMessage(XrayStopResponse)
-
-XrayFetchVersionRequest = _reflection.GeneratedProtocolMessageType('XrayFetchVersionRequest', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYFETCHVERSIONREQUEST,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayFetchVersionRequest)
- })
-_sym_db.RegisterMessage(XrayFetchVersionRequest)
-
-XrayFetchVersionResponse = _reflection.GeneratedProtocolMessageType('XrayFetchVersionResponse', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYFETCHVERSIONRESPONSE,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayFetchVersionResponse)
- })
-_sym_db.RegisterMessage(XrayFetchVersionResponse)
-
-XrayLogsRequest = _reflection.GeneratedProtocolMessageType('XrayLogsRequest', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYLOGSREQUEST,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayLogsRequest)
- })
-_sym_db.RegisterMessage(XrayLogsRequest)
-
-XrayLogsResponse = _reflection.GeneratedProtocolMessageType('XrayLogsResponse', (_message.Message,), {
- 'DESCRIPTOR' : _XRAYLOGSRESPONSE,
- '__module__' : 'service_pb2'
- # @@protoc_insertion_point(class_scope:mnode.XrayLogsResponse)
- })
-_sym_db.RegisterMessage(XrayLogsResponse)
-
-_XRAYSERVICE = DESCRIPTOR.services_by_name['XrayService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- _XRAYSTARTREQUEST._serialized_start=24
- _XRAYSTARTREQUEST._serialized_end=58
- _XRAYSTARTRESPONSE._serialized_start=61
- _XRAYSTARTRESPONSE._serialized_end=195
- _XRAYRESTARTREQUEST._serialized_start=197
- _XRAYRESTARTREQUEST._serialized_end=233
- _XRAYRESTARTRESPONSE._serialized_start=236
- _XRAYRESTARTRESPONSE._serialized_end=364
- _XRAYSTOPREQUEST._serialized_start=366
- _XRAYSTOPREQUEST._serialized_end=383
- _XRAYSTOPRESPONSE._serialized_start=385
- _XRAYSTOPRESPONSE._serialized_end=403
- _XRAYFETCHVERSIONREQUEST._serialized_start=405
- _XRAYFETCHVERSIONREQUEST._serialized_end=430
- _XRAYFETCHVERSIONRESPONSE._serialized_start=432
- _XRAYFETCHVERSIONRESPONSE._serialized_end=475
- _XRAYLOGSREQUEST._serialized_start=477
- _XRAYLOGSREQUEST._serialized_end=494
- _XRAYLOGSRESPONSE._serialized_start=496
- _XRAYLOGSRESPONSE._serialized_end=528
- _XRAYSERVICE._serialized_start=531
- _XRAYSERVICE._serialized_end=893
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/__init__.py b/xray_api/__init__.py
@@ -1,17 +0,0 @@
-from . import exceptions
-from . import exceptions as exc
-from . import types
-from .proxyman import Proxyman
-from .stats import Stats
-
-
-class XRay(Proxyman, Stats):
- pass
-
-
-__all__ = [
- "XRay",
- "exceptions",
- "exc",
- "types"
-]
diff --git a/xray_api/base.py b/xray_api/base.py
@@ -1,18 +0,0 @@
-import grpclib
-# import asyncio
-# import functools
-import ssl
-
-class XRayBase(object):
- def __init__(self, address: str, port: int, ssl_cert: str = None, ssl_target_name: str = None):
- self.ssl_context = None
- if ssl_cert:
- self.ssl_context = ssl.create_default_context(cadata=ssl_cert)
- self.ssl_context.check_hostname = False
- self._channel = None
- self.address = address
- self.port = port
-
- def create_channel(self):
- if not self._channel:
- self._channel = grpclib.client.Channel(self.address, self.port, ssl=self.ssl_context)
diff --git a/xray_api/exceptions.py b/xray_api/exceptions.py
@@ -1,60 +0,0 @@
-import re
-
-import grpclib
-
-
-class XrayError(Exception):
- REGEXP = ...
-
- def __init__(self, details):
- self.details = details
-
-
-class EmailExistsError(XrayError):
- REGEXP = re.compile(r"User (.*) already exists.")
-
- def __init__(self, details, email):
- self.email = email
- super().__init__(details)
-
-
-class EmailNotFoundError(XrayError):
- REGEXP = re.compile(r"User (.*) not found.")
-
- def __init__(self, details, email):
- self.email = email
- super().__init__(details)
-
-
-class TagNotFoundError(XrayError):
- REGEXP = re.compile(r"handler not found: (.*)")
-
- def __init__(self, details, tag):
- self.tag = tag
- super().__init__(details)
-
-
-class ConnectionError(XrayError):
- REGEXP = re.compile(r"Failed to connect to remote host|Socket closed|Broken pipe")
-
- def __init__(self, details, tag):
- self.tag = tag
- super().__init__(details)
-
-
-class UnknownError(XrayError):
- def __init__(self, details=''):
- super().__init__(details)
-
-
-class RelatedError(XrayError):
- def __new__(cls, error: grpclib.exceptions.GRPCError):
- details = error.message
- for e in (EmailExistsError, EmailNotFoundError, TagNotFoundError, ConnectionError):
- args = e.REGEXP.findall(details)
- if not args:
- continue
-
- return e(details, *args)
-
- return UnknownError(details)
diff --git a/xray_api/proto/app/commander/config_grpc.py b/xray_api/proto/app/commander/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/commander/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/commander/config_pb2.py b/xray_api/proto/app/commander/config_pb2.py
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/commander/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x61pp/commander/config.proto\x12\x12xray.app.commander\x1a!common/serial/typed_message.proto\"H\n\x06\x43onfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x31\n\x07service\x18\x02 \x03(\x0b\x32 .xray.common.serial.TypedMessage\"\x12\n\x10ReflectionConfigBX\n\x16\x63om.xray.app.commanderP\x01Z\'github.com/xtls/xray-core/app/commander\xaa\x02\x12Xray.App.Commanderb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_REFLECTIONCONFIG = DESCRIPTOR.message_types_by_name['ReflectionConfig']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.commander.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.commander.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-ReflectionConfig = _reflection.GeneratedProtocolMessageType('ReflectionConfig', (_message.Message,), {
- 'DESCRIPTOR' : _REFLECTIONCONFIG,
- '__module__' : 'app.commander.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.commander.ReflectionConfig)
- })
-_sym_db.RegisterMessage(ReflectionConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\026com.xray.app.commanderP\001Z\'github.com/xtls/xray-core/app/commander\252\002\022Xray.App.Commander'
- _CONFIG._serialized_start=85
- _CONFIG._serialized_end=157
- _REFLECTIONCONFIG._serialized_start=159
- _REFLECTIONCONFIG._serialized_end=177
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/dispatcher/config_grpc.py b/xray_api/proto/app/dispatcher/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/dispatcher/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/dispatcher/config_pb2.py b/xray_api/proto/app/dispatcher/config_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/dispatcher/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x61pp/dispatcher/config.proto\x12\x13xray.app.dispatcher\"\x15\n\rSessionConfigJ\x04\x08\x01\x10\x02\">\n\x06\x43onfig\x12\x34\n\x08settings\x18\x01 \x01(\x0b\x32\".xray.app.dispatcher.SessionConfigB[\n\x17\x63om.xray.app.dispatcherP\x01Z(github.com/xtls/xray-core/app/dispatcher\xaa\x02\x13Xray.App.Dispatcherb\x06proto3')
-
-
-
-_SESSIONCONFIG = DESCRIPTOR.message_types_by_name['SessionConfig']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-SessionConfig = _reflection.GeneratedProtocolMessageType('SessionConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SESSIONCONFIG,
- '__module__' : 'app.dispatcher.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dispatcher.SessionConfig)
- })
-_sym_db.RegisterMessage(SessionConfig)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.dispatcher.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dispatcher.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\027com.xray.app.dispatcherP\001Z(github.com/xtls/xray-core/app/dispatcher\252\002\023Xray.App.Dispatcher'
- _SESSIONCONFIG._serialized_start=52
- _SESSIONCONFIG._serialized_end=73
- _CONFIG._serialized_start=75
- _CONFIG._serialized_end=137
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/dns/config_grpc.py b/xray_api/proto/app/dns/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/dns/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/dns/config_pb2.py b/xray_api/proto/app/dns/config_pb2.py
@@ -1,114 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/dns/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-from xray_api.proto.common.net import destination_pb2 as common_dot_net_dot_destination__pb2
-from xray_api.proto.app.router import config_pb2 as app_dot_router_dot_config__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61pp/dns/config.proto\x12\x0cxray.app.dns\x1a\x18\x63ommon/net/address.proto\x1a\x1c\x63ommon/net/destination.proto\x1a\x17\x61pp/router/config.proto\"\xbf\x03\n\nNameServer\x12*\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x19.xray.common.net.Endpoint\x12\x11\n\tclient_ip\x18\x05 \x01(\x0c\x12\x14\n\x0cskipFallback\x18\x06 \x01(\x08\x12\x43\n\x12prioritized_domain\x18\x02 \x03(\x0b\x32\'.xray.app.dns.NameServer.PriorityDomain\x12%\n\x05geoip\x18\x03 \x03(\x0b\x32\x16.xray.app.router.GeoIP\x12=\n\x0eoriginal_rules\x18\x04 \x03(\x0b\x32%.xray.app.dns.NameServer.OriginalRule\x12\x33\n\x0equery_strategy\x18\x07 \x01(\x0e\x32\x1b.xray.app.dns.QueryStrategy\x1aP\n\x0ePriorityDomain\x12.\n\x04type\x18\x01 \x01(\x0e\x32 .xray.app.dns.DomainMatchingType\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x1a*\n\x0cOriginalRule\x12\x0c\n\x04rule\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\r\"\xbf\x04\n\x06\x43onfig\x12\x32\n\x0bNameServers\x18\x01 \x03(\x0b\x32\x19.xray.common.net.EndpointB\x02\x18\x01\x12-\n\x0bname_server\x18\x05 \x03(\x0b\x32\x18.xray.app.dns.NameServer\x12\x32\n\x05Hosts\x18\x02 \x03(\x0b\x32\x1f.xray.app.dns.Config.HostsEntryB\x02\x18\x01\x12\x11\n\tclient_ip\x18\x03 \x01(\x0c\x12\x36\n\x0cstatic_hosts\x18\x04 \x03(\x0b\x32 .xray.app.dns.Config.HostMapping\x12\x0b\n\x03tag\x18\x06 \x01(\t\x12\x14\n\x0c\x64isableCache\x18\x08 \x01(\x08\x12\x33\n\x0equery_strategy\x18\t \x01(\x0e\x32\x1b.xray.app.dns.QueryStrategy\x12\x17\n\x0f\x64isableFallback\x18\n \x01(\x08\x12\x1e\n\x16\x64isableFallbackIfMatch\x18\x0b \x01(\x08\x1aI\n\nHostsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain:\x02\x38\x01\x1aq\n\x0bHostMapping\x12.\n\x04type\x18\x01 \x01(\x0e\x32 .xray.app.dns.DomainMatchingType\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\n\n\x02ip\x18\x03 \x03(\x0c\x12\x16\n\x0eproxied_domain\x18\x04 \x01(\tJ\x04\x08\x07\x10\x08*E\n\x12\x44omainMatchingType\x12\x08\n\x04\x46ull\x10\x00\x12\r\n\tSubdomain\x10\x01\x12\x0b\n\x07Keyword\x10\x02\x12\t\n\x05Regex\x10\x03*5\n\rQueryStrategy\x12\n\n\x06USE_IP\x10\x00\x12\x0b\n\x07USE_IP4\x10\x01\x12\x0b\n\x07USE_IP6\x10\x02\x42\x46\n\x10\x63om.xray.app.dnsP\x01Z!github.com/xtls/xray-core/app/dns\xaa\x02\x0cXray.App.Dnsb\x06proto3')
-
-_DOMAINMATCHINGTYPE = DESCRIPTOR.enum_types_by_name['DomainMatchingType']
-DomainMatchingType = enum_type_wrapper.EnumTypeWrapper(_DOMAINMATCHINGTYPE)
-_QUERYSTRATEGY = DESCRIPTOR.enum_types_by_name['QueryStrategy']
-QueryStrategy = enum_type_wrapper.EnumTypeWrapper(_QUERYSTRATEGY)
-Full = 0
-Subdomain = 1
-Keyword = 2
-Regex = 3
-USE_IP = 0
-USE_IP4 = 1
-USE_IP6 = 2
-
-
-_NAMESERVER = DESCRIPTOR.message_types_by_name['NameServer']
-_NAMESERVER_PRIORITYDOMAIN = _NAMESERVER.nested_types_by_name['PriorityDomain']
-_NAMESERVER_ORIGINALRULE = _NAMESERVER.nested_types_by_name['OriginalRule']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CONFIG_HOSTSENTRY = _CONFIG.nested_types_by_name['HostsEntry']
-_CONFIG_HOSTMAPPING = _CONFIG.nested_types_by_name['HostMapping']
-NameServer = _reflection.GeneratedProtocolMessageType('NameServer', (_message.Message,), {
-
- 'PriorityDomain' : _reflection.GeneratedProtocolMessageType('PriorityDomain', (_message.Message,), {
- 'DESCRIPTOR' : _NAMESERVER_PRIORITYDOMAIN,
- '__module__' : 'app.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.NameServer.PriorityDomain)
- })
- ,
-
- 'OriginalRule' : _reflection.GeneratedProtocolMessageType('OriginalRule', (_message.Message,), {
- 'DESCRIPTOR' : _NAMESERVER_ORIGINALRULE,
- '__module__' : 'app.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.NameServer.OriginalRule)
- })
- ,
- 'DESCRIPTOR' : _NAMESERVER,
- '__module__' : 'app.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.NameServer)
- })
-_sym_db.RegisterMessage(NameServer)
-_sym_db.RegisterMessage(NameServer.PriorityDomain)
-_sym_db.RegisterMessage(NameServer.OriginalRule)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
-
- 'HostsEntry' : _reflection.GeneratedProtocolMessageType('HostsEntry', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG_HOSTSENTRY,
- '__module__' : 'app.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.Config.HostsEntry)
- })
- ,
-
- 'HostMapping' : _reflection.GeneratedProtocolMessageType('HostMapping', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG_HOSTMAPPING,
- '__module__' : 'app.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.Config.HostMapping)
- })
- ,
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.Config)
- })
-_sym_db.RegisterMessage(Config)
-_sym_db.RegisterMessage(Config.HostsEntry)
-_sym_db.RegisterMessage(Config.HostMapping)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\020com.xray.app.dnsP\001Z!github.com/xtls/xray-core/app/dns\252\002\014Xray.App.Dns'
- _CONFIG_HOSTSENTRY._options = None
- _CONFIG_HOSTSENTRY._serialized_options = b'8\001'
- _CONFIG.fields_by_name['NameServers']._options = None
- _CONFIG.fields_by_name['NameServers']._serialized_options = b'\030\001'
- _CONFIG.fields_by_name['Hosts']._options = None
- _CONFIG.fields_by_name['Hosts']._serialized_options = b'\030\001'
- _DOMAINMATCHINGTYPE._serialized_start=1147
- _DOMAINMATCHINGTYPE._serialized_end=1216
- _QUERYSTRATEGY._serialized_start=1218
- _QUERYSTRATEGY._serialized_end=1271
- _NAMESERVER._serialized_start=120
- _NAMESERVER._serialized_end=567
- _NAMESERVER_PRIORITYDOMAIN._serialized_start=443
- _NAMESERVER_PRIORITYDOMAIN._serialized_end=523
- _NAMESERVER_ORIGINALRULE._serialized_start=525
- _NAMESERVER_ORIGINALRULE._serialized_end=567
- _CONFIG._serialized_start=570
- _CONFIG._serialized_end=1145
- _CONFIG_HOSTSENTRY._serialized_start=951
- _CONFIG_HOSTSENTRY._serialized_end=1024
- _CONFIG_HOSTMAPPING._serialized_start=1026
- _CONFIG_HOSTMAPPING._serialized_end=1139
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/dns/fakedns/fakedns_grpc.py b/xray_api/proto/app/dns/fakedns/fakedns_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/dns/fakedns/fakedns.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/dns/fakedns/fakedns_pb2.py b/xray_api/proto/app/dns/fakedns/fakedns_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/dns/fakedns/fakedns.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x61pp/dns/fakedns/fakedns.proto\x12\x14xray.app.dns.fakedns\"/\n\x0b\x46\x61keDnsPool\x12\x0f\n\x07ip_pool\x18\x01 \x01(\t\x12\x0f\n\x07lruSize\x18\x02 \x01(\x03\"D\n\x10\x46\x61keDnsPoolMulti\x12\x30\n\x05pools\x18\x01 \x03(\x0b\x32!.xray.app.dns.fakedns.FakeDnsPoolB^\n\x18\x63om.xray.app.dns.fakednsP\x01Z)github.com/xtls/xray-core/app/dns/fakedns\xaa\x02\x14Xray.App.Dns.Fakednsb\x06proto3')
-
-
-
-_FAKEDNSPOOL = DESCRIPTOR.message_types_by_name['FakeDnsPool']
-_FAKEDNSPOOLMULTI = DESCRIPTOR.message_types_by_name['FakeDnsPoolMulti']
-FakeDnsPool = _reflection.GeneratedProtocolMessageType('FakeDnsPool', (_message.Message,), {
- 'DESCRIPTOR' : _FAKEDNSPOOL,
- '__module__' : 'app.dns.fakedns.fakedns_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.fakedns.FakeDnsPool)
- })
-_sym_db.RegisterMessage(FakeDnsPool)
-
-FakeDnsPoolMulti = _reflection.GeneratedProtocolMessageType('FakeDnsPoolMulti', (_message.Message,), {
- 'DESCRIPTOR' : _FAKEDNSPOOLMULTI,
- '__module__' : 'app.dns.fakedns.fakedns_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.dns.fakedns.FakeDnsPoolMulti)
- })
-_sym_db.RegisterMessage(FakeDnsPoolMulti)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.app.dns.fakednsP\001Z)github.com/xtls/xray-core/app/dns/fakedns\252\002\024Xray.App.Dns.Fakedns'
- _FAKEDNSPOOL._serialized_start=55
- _FAKEDNSPOOL._serialized_end=102
- _FAKEDNSPOOLMULTI._serialized_start=104
- _FAKEDNSPOOLMULTI._serialized_end=172
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/log/command/config_grpc.py b/xray_api/proto/app/log/command/config_grpc.py
@@ -1,40 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/log/command/config.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import xray_api.proto.app.log.command.config_pb2
-
-
-class LoggerServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def RestartLogger(self, stream: 'grpclib.server.Stream[app.log.command.config_pb2.RestartLoggerRequest, app.log.command.config_pb2.RestartLoggerResponse]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/xray.app.log.command.LoggerService/RestartLogger': grpclib.const.Handler(
- self.RestartLogger,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.log.command.config_pb2.RestartLoggerRequest,
- xray_api.proto.app.log.command.config_pb2.RestartLoggerResponse,
- ),
- }
-
-
-class LoggerServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.RestartLogger = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.log.command.LoggerService/RestartLogger',
- xray_api.proto.app.log.command.config_pb2.RestartLoggerRequest,
- xray_api.proto.app.log.command.config_pb2.RestartLoggerResponse,
- )
diff --git a/xray_api/proto/app/log/command/config_pb2.py b/xray_api/proto/app/log/command/config_pb2.py
@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/log/command/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x61pp/log/command/config.proto\x12\x14xray.app.log.command\"\x08\n\x06\x43onfig\"\x16\n\x14RestartLoggerRequest\"\x17\n\x15RestartLoggerResponse2{\n\rLoggerService\x12j\n\rRestartLogger\x12*.xray.app.log.command.RestartLoggerRequest\x1a+.xray.app.log.command.RestartLoggerResponse\"\x00\x42^\n\x18\x63om.xray.app.log.commandP\x01Z)github.com/xtls/xray-core/app/log/command\xaa\x02\x14Xray.App.Log.Commandb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_RESTARTLOGGERREQUEST = DESCRIPTOR.message_types_by_name['RestartLoggerRequest']
-_RESTARTLOGGERRESPONSE = DESCRIPTOR.message_types_by_name['RestartLoggerResponse']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.log.command.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.log.command.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-RestartLoggerRequest = _reflection.GeneratedProtocolMessageType('RestartLoggerRequest', (_message.Message,), {
- 'DESCRIPTOR' : _RESTARTLOGGERREQUEST,
- '__module__' : 'app.log.command.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.log.command.RestartLoggerRequest)
- })
-_sym_db.RegisterMessage(RestartLoggerRequest)
-
-RestartLoggerResponse = _reflection.GeneratedProtocolMessageType('RestartLoggerResponse', (_message.Message,), {
- 'DESCRIPTOR' : _RESTARTLOGGERRESPONSE,
- '__module__' : 'app.log.command.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.log.command.RestartLoggerResponse)
- })
-_sym_db.RegisterMessage(RestartLoggerResponse)
-
-_LOGGERSERVICE = DESCRIPTOR.services_by_name['LoggerService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.app.log.commandP\001Z)github.com/xtls/xray-core/app/log/command\252\002\024Xray.App.Log.Command'
- _CONFIG._serialized_start=54
- _CONFIG._serialized_end=62
- _RESTARTLOGGERREQUEST._serialized_start=64
- _RESTARTLOGGERREQUEST._serialized_end=86
- _RESTARTLOGGERRESPONSE._serialized_start=88
- _RESTARTLOGGERRESPONSE._serialized_end=111
- _LOGGERSERVICE._serialized_start=113
- _LOGGERSERVICE._serialized_end=236
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/log/config_grpc.py b/xray_api/proto/app/log/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/log/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/log/config_pb2.py b/xray_api/proto/app/log/config_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/log/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.log import log_pb2 as common_dot_log_dot_log__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x61pp/log/config.proto\x12\x0cxray.app.log\x1a\x14\x63ommon/log/log.proto\"\xe4\x01\n\x06\x43onfig\x12-\n\x0e\x65rror_log_type\x18\x01 \x01(\x0e\x32\x15.xray.app.log.LogType\x12\x32\n\x0f\x65rror_log_level\x18\x02 \x01(\x0e\x32\x19.xray.common.log.Severity\x12\x16\n\x0e\x65rror_log_path\x18\x03 \x01(\t\x12.\n\x0f\x61\x63\x63\x65ss_log_type\x18\x04 \x01(\x0e\x32\x15.xray.app.log.LogType\x12\x17\n\x0f\x61\x63\x63\x65ss_log_path\x18\x05 \x01(\t\x12\x16\n\x0e\x65nable_dns_log\x18\x06 \x01(\x08*5\n\x07LogType\x12\x08\n\x04None\x10\x00\x12\x0b\n\x07\x43onsole\x10\x01\x12\x08\n\x04\x46ile\x10\x02\x12\t\n\x05\x45vent\x10\x03\x42\x46\n\x10\x63om.xray.app.logP\x01Z!github.com/xtls/xray-core/app/log\xaa\x02\x0cXray.App.Logb\x06proto3')
-
-_LOGTYPE = DESCRIPTOR.enum_types_by_name['LogType']
-LogType = enum_type_wrapper.EnumTypeWrapper(_LOGTYPE)
-globals()['None'] = 0
-Console = 1
-File = 2
-Event = 3
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.log.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.log.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\020com.xray.app.logP\001Z!github.com/xtls/xray-core/app/log\252\002\014Xray.App.Log'
- _LOGTYPE._serialized_start=291
- _LOGTYPE._serialized_end=344
- _CONFIG._serialized_start=61
- _CONFIG._serialized_end=289
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/metrics/config_grpc.py b/xray_api/proto/app/metrics/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/metrics/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/metrics/config_pb2.py b/xray_api/proto/app/metrics/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/metrics/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x61pp/metrics/config.proto\x12\x10xray.app.metrics\"\x15\n\x06\x43onfig\x12\x0b\n\x03tag\x18\x01 \x01(\tBR\n\x14\x63om.xray.app.metricsP\x01Z%github.com/xtls/xray-core/app/metrics\xaa\x02\x10Xray.App.Metricsb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.metrics.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.metrics.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\024com.xray.app.metricsP\001Z%github.com/xtls/xray-core/app/metrics\252\002\020Xray.App.Metrics'
- _CONFIG._serialized_start=46
- _CONFIG._serialized_end=67
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/observatory/command/command_grpc.py b/xray_api/proto/app/observatory/command/command_grpc.py
@@ -1,41 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/observatory/command/command.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import xray_api.proto.app.observatory.config_pb2
-import xray_api.proto.app.observatory.command.command_pb2
-
-
-class ObservatoryServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def GetOutboundStatus(self, stream: 'grpclib.server.Stream[app.observatory.command.command_pb2.GetOutboundStatusRequest, app.observatory.command.command_pb2.GetOutboundStatusResponse]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/xray.core.app.observatory.command.ObservatoryService/GetOutboundStatus': grpclib.const.Handler(
- self.GetOutboundStatus,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.observatory.command.command_pb2.GetOutboundStatusRequest,
- xray_api.proto.app.observatory.command.command_pb2.GetOutboundStatusResponse,
- ),
- }
-
-
-class ObservatoryServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.GetOutboundStatus = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.core.app.observatory.command.ObservatoryService/GetOutboundStatus',
- xray_api.proto.app.observatory.command.command_pb2.GetOutboundStatusRequest,
- xray_api.proto.app.observatory.command.command_pb2.GetOutboundStatusResponse,
- )
diff --git a/xray_api/proto/app/observatory/command/command_pb2.py b/xray_api/proto/app/observatory/command/command_pb2.py
@@ -1,59 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/observatory/command/command.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.app.observatory import config_pb2 as app_dot_observatory_dot_config__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%app/observatory/command/command.proto\x12!xray.core.app.observatory.command\x1a\x1c\x61pp/observatory/config.proto\"\x1a\n\x18GetOutboundStatusRequest\"Y\n\x19GetOutboundStatusResponse\x12<\n\x06status\x18\x01 \x01(\x0b\x32,.xray.core.app.observatory.ObservationResult\"\x08\n\x06\x43onfig2\xa7\x01\n\x12ObservatoryService\x12\x90\x01\n\x11GetOutboundStatus\x12;.xray.core.app.observatory.command.GetOutboundStatusRequest\x1a<.xray.core.app.observatory.command.GetOutboundStatusResponse\"\x00\x42\x80\x01\n%com.xray.core.app.observatory.commandP\x01Z1github.com/xtls/xray-core/app/observatory/command\xaa\x02!Xray.Core.App.Observatory.Commandb\x06proto3')
-
-
-
-_GETOUTBOUNDSTATUSREQUEST = DESCRIPTOR.message_types_by_name['GetOutboundStatusRequest']
-_GETOUTBOUNDSTATUSRESPONSE = DESCRIPTOR.message_types_by_name['GetOutboundStatusResponse']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-GetOutboundStatusRequest = _reflection.GeneratedProtocolMessageType('GetOutboundStatusRequest', (_message.Message,), {
- 'DESCRIPTOR' : _GETOUTBOUNDSTATUSREQUEST,
- '__module__' : 'app.observatory.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.command.GetOutboundStatusRequest)
- })
-_sym_db.RegisterMessage(GetOutboundStatusRequest)
-
-GetOutboundStatusResponse = _reflection.GeneratedProtocolMessageType('GetOutboundStatusResponse', (_message.Message,), {
- 'DESCRIPTOR' : _GETOUTBOUNDSTATUSRESPONSE,
- '__module__' : 'app.observatory.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.command.GetOutboundStatusResponse)
- })
-_sym_db.RegisterMessage(GetOutboundStatusResponse)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.observatory.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.command.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-_OBSERVATORYSERVICE = DESCRIPTOR.services_by_name['ObservatoryService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n%com.xray.core.app.observatory.commandP\001Z1github.com/xtls/xray-core/app/observatory/command\252\002!Xray.Core.App.Observatory.Command'
- _GETOUTBOUNDSTATUSREQUEST._serialized_start=106
- _GETOUTBOUNDSTATUSREQUEST._serialized_end=132
- _GETOUTBOUNDSTATUSRESPONSE._serialized_start=134
- _GETOUTBOUNDSTATUSRESPONSE._serialized_end=223
- _CONFIG._serialized_start=225
- _CONFIG._serialized_end=233
- _OBSERVATORYSERVICE._serialized_start=236
- _OBSERVATORYSERVICE._serialized_end=403
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/observatory/config_grpc.py b/xray_api/proto/app/observatory/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/observatory/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/observatory/config_pb2.py b/xray_api/proto/app/observatory/config_pb2.py
@@ -1,75 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/observatory/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x61pp/observatory/config.proto\x12\x19xray.core.app.observatory\"N\n\x11ObservationResult\x12\x39\n\x06status\x18\x01 \x03(\x0b\x32).xray.core.app.observatory.OutboundStatus\"\x8e\x01\n\x0eOutboundStatus\x12\r\n\x05\x61live\x18\x01 \x01(\x08\x12\r\n\x05\x64\x65lay\x18\x02 \x01(\x03\x12\x19\n\x11last_error_reason\x18\x03 \x01(\t\x12\x14\n\x0coutbound_tag\x18\x04 \x01(\t\x12\x16\n\x0elast_seen_time\x18\x05 \x01(\x03\x12\x15\n\rlast_try_time\x18\x06 \x01(\x03\"F\n\x0bProbeResult\x12\r\n\x05\x61live\x18\x01 \x01(\x08\x12\r\n\x05\x64\x65lay\x18\x02 \x01(\x03\x12\x19\n\x11last_error_reason\x18\x03 \x01(\t\"#\n\tIntensity\x12\x16\n\x0eprobe_interval\x18\x01 \x01(\r\"i\n\x06\x43onfig\x12\x18\n\x10subject_selector\x18\x02 \x03(\t\x12\x11\n\tprobe_url\x18\x03 \x01(\t\x12\x16\n\x0eprobe_interval\x18\x04 \x01(\x03\x12\x1a\n\x12\x65nable_concurrency\x18\x05 \x01(\x08\x42^\n\x18\x63om.xray.app.observatoryP\x01Z)github.com/xtls/xray-core/app/observatory\xaa\x02\x14Xray.App.Observatoryb\x06proto3')
-
-
-
-_OBSERVATIONRESULT = DESCRIPTOR.message_types_by_name['ObservationResult']
-_OUTBOUNDSTATUS = DESCRIPTOR.message_types_by_name['OutboundStatus']
-_PROBERESULT = DESCRIPTOR.message_types_by_name['ProbeResult']
-_INTENSITY = DESCRIPTOR.message_types_by_name['Intensity']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-ObservationResult = _reflection.GeneratedProtocolMessageType('ObservationResult', (_message.Message,), {
- 'DESCRIPTOR' : _OBSERVATIONRESULT,
- '__module__' : 'app.observatory.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.ObservationResult)
- })
-_sym_db.RegisterMessage(ObservationResult)
-
-OutboundStatus = _reflection.GeneratedProtocolMessageType('OutboundStatus', (_message.Message,), {
- 'DESCRIPTOR' : _OUTBOUNDSTATUS,
- '__module__' : 'app.observatory.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.OutboundStatus)
- })
-_sym_db.RegisterMessage(OutboundStatus)
-
-ProbeResult = _reflection.GeneratedProtocolMessageType('ProbeResult', (_message.Message,), {
- 'DESCRIPTOR' : _PROBERESULT,
- '__module__' : 'app.observatory.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.ProbeResult)
- })
-_sym_db.RegisterMessage(ProbeResult)
-
-Intensity = _reflection.GeneratedProtocolMessageType('Intensity', (_message.Message,), {
- 'DESCRIPTOR' : _INTENSITY,
- '__module__' : 'app.observatory.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.Intensity)
- })
-_sym_db.RegisterMessage(Intensity)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.observatory.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.xray_api.proto.app.observatory.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.app.observatoryP\001Z)github.com/xtls/xray-core/app/observatory\252\002\024Xray.App.Observatory'
- _OBSERVATIONRESULT._serialized_start=59
- _OBSERVATIONRESULT._serialized_end=137
- _OUTBOUNDSTATUS._serialized_start=140
- _OUTBOUNDSTATUS._serialized_end=282
- _PROBERESULT._serialized_start=284
- _PROBERESULT._serialized_end=354
- _INTENSITY._serialized_start=356
- _INTENSITY._serialized_end=391
- _CONFIG._serialized_start=393
- _CONFIG._serialized_end=498
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/policy/config_grpc.py b/xray_api/proto/app/policy/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/policy/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/policy/config_pb2.py b/xray_api/proto/app/policy/config_pb2.py
@@ -1,122 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/policy/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x61pp/policy/config.proto\x12\x0fxray.app.policy\"\x17\n\x06Second\x12\r\n\x05value\x18\x01 \x01(\r\"\xb3\x03\n\x06Policy\x12\x30\n\x07timeout\x18\x01 \x01(\x0b\x32\x1f.xray.app.policy.Policy.Timeout\x12,\n\x05stats\x18\x02 \x01(\x0b\x32\x1d.xray.app.policy.Policy.Stats\x12.\n\x06\x62uffer\x18\x03 \x01(\x0b\x32\x1e.xray.app.policy.Policy.Buffer\x1a\xc5\x01\n\x07Timeout\x12*\n\thandshake\x18\x01 \x01(\x0b\x32\x17.xray.app.policy.Second\x12\x30\n\x0f\x63onnection_idle\x18\x02 \x01(\x0b\x32\x17.xray.app.policy.Second\x12,\n\x0buplink_only\x18\x03 \x01(\x0b\x32\x17.xray.app.policy.Second\x12.\n\rdownlink_only\x18\x04 \x01(\x0b\x32\x17.xray.app.policy.Second\x1a\x33\n\x05Stats\x12\x13\n\x0buser_uplink\x18\x01 \x01(\x08\x12\x15\n\ruser_downlink\x18\x02 \x01(\x08\x1a\x1c\n\x06\x42uffer\x12\x12\n\nconnection\x18\x01 \x01(\x05\"\xb1\x01\n\x0cSystemPolicy\x12\x32\n\x05stats\x18\x01 \x01(\x0b\x32#.xray.app.policy.SystemPolicy.Stats\x1am\n\x05Stats\x12\x16\n\x0einbound_uplink\x18\x01 \x01(\x08\x12\x18\n\x10inbound_downlink\x18\x02 \x01(\x08\x12\x17\n\x0foutbound_uplink\x18\x03 \x01(\x08\x12\x19\n\x11outbound_downlink\x18\x04 \x01(\x08\"\xb1\x01\n\x06\x43onfig\x12\x31\n\x05level\x18\x01 \x03(\x0b\x32\".xray.app.policy.Config.LevelEntry\x12-\n\x06system\x18\x02 \x01(\x0b\x32\x1d.xray.app.policy.SystemPolicy\x1a\x45\n\nLevelEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.xray.app.policy.Policy:\x02\x38\x01\x42O\n\x13\x63om.xray.app.policyP\x01Z$github.com/xtls/xray-core/app/policy\xaa\x02\x0fXray.App.Policyb\x06proto3')
-
-
-
-_SECOND = DESCRIPTOR.message_types_by_name['Second']
-_POLICY = DESCRIPTOR.message_types_by_name['Policy']
-_POLICY_TIMEOUT = _POLICY.nested_types_by_name['Timeout']
-_POLICY_STATS = _POLICY.nested_types_by_name['Stats']
-_POLICY_BUFFER = _POLICY.nested_types_by_name['Buffer']
-_SYSTEMPOLICY = DESCRIPTOR.message_types_by_name['SystemPolicy']
-_SYSTEMPOLICY_STATS = _SYSTEMPOLICY.nested_types_by_name['Stats']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CONFIG_LEVELENTRY = _CONFIG.nested_types_by_name['LevelEntry']
-Second = _reflection.GeneratedProtocolMessageType('Second', (_message.Message,), {
- 'DESCRIPTOR' : _SECOND,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Second)
- })
-_sym_db.RegisterMessage(Second)
-
-Policy = _reflection.GeneratedProtocolMessageType('Policy', (_message.Message,), {
-
- 'Timeout' : _reflection.GeneratedProtocolMessageType('Timeout', (_message.Message,), {
- 'DESCRIPTOR' : _POLICY_TIMEOUT,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Policy.Timeout)
- })
- ,
-
- 'Stats' : _reflection.GeneratedProtocolMessageType('Stats', (_message.Message,), {
- 'DESCRIPTOR' : _POLICY_STATS,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Policy.Stats)
- })
- ,
-
- 'Buffer' : _reflection.GeneratedProtocolMessageType('Buffer', (_message.Message,), {
- 'DESCRIPTOR' : _POLICY_BUFFER,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Policy.Buffer)
- })
- ,
- 'DESCRIPTOR' : _POLICY,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Policy)
- })
-_sym_db.RegisterMessage(Policy)
-_sym_db.RegisterMessage(Policy.Timeout)
-_sym_db.RegisterMessage(Policy.Stats)
-_sym_db.RegisterMessage(Policy.Buffer)
-
-SystemPolicy = _reflection.GeneratedProtocolMessageType('SystemPolicy', (_message.Message,), {
-
- 'Stats' : _reflection.GeneratedProtocolMessageType('Stats', (_message.Message,), {
- 'DESCRIPTOR' : _SYSTEMPOLICY_STATS,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.SystemPolicy.Stats)
- })
- ,
- 'DESCRIPTOR' : _SYSTEMPOLICY,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.SystemPolicy)
- })
-_sym_db.RegisterMessage(SystemPolicy)
-_sym_db.RegisterMessage(SystemPolicy.Stats)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
-
- 'LevelEntry' : _reflection.GeneratedProtocolMessageType('LevelEntry', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG_LEVELENTRY,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Config.LevelEntry)
- })
- ,
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.policy.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.policy.Config)
- })
-_sym_db.RegisterMessage(Config)
-_sym_db.RegisterMessage(Config.LevelEntry)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.app.policyP\001Z$github.com/xtls/xray-core/app/policy\252\002\017Xray.App.Policy'
- _CONFIG_LEVELENTRY._options = None
- _CONFIG_LEVELENTRY._serialized_options = b'8\001'
- _SECOND._serialized_start=44
- _SECOND._serialized_end=67
- _POLICY._serialized_start=70
- _POLICY._serialized_end=505
- _POLICY_TIMEOUT._serialized_start=225
- _POLICY_TIMEOUT._serialized_end=422
- _POLICY_STATS._serialized_start=424
- _POLICY_STATS._serialized_end=475
- _POLICY_BUFFER._serialized_start=477
- _POLICY_BUFFER._serialized_end=505
- _SYSTEMPOLICY._serialized_start=508
- _SYSTEMPOLICY._serialized_end=685
- _SYSTEMPOLICY_STATS._serialized_start=576
- _SYSTEMPOLICY_STATS._serialized_end=685
- _CONFIG._serialized_start=688
- _CONFIG._serialized_end=865
- _CONFIG_LEVELENTRY._serialized_start=796
- _CONFIG_LEVELENTRY._serialized_end=865
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/proxyman/command/command_grpc.py b/xray_api/proto/app/proxyman/command/command_grpc.py
@@ -1,123 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/proxyman/command/command.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import xray_api.proto.common.protocol.user_pb2
-import xray_api.proto.common.serial.typed_message_pb2
-import xray_api.proto.core.config_pb2
-import xray_api.proto.app.proxyman.command.command_pb2
-
-
-class HandlerServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def AddInbound(self, stream: 'grpclib.server.Stream[app.proxyman.command.command_pb2.AddInboundRequest, app.proxyman.command.command_pb2.AddInboundResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def RemoveInbound(self, stream: 'grpclib.server.Stream[app.proxyman.command.command_pb2.RemoveInboundRequest, app.proxyman.command.command_pb2.RemoveInboundResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def AlterInbound(self, stream: 'grpclib.server.Stream[app.proxyman.command.command_pb2.AlterInboundRequest, app.proxyman.command.command_pb2.AlterInboundResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def AddOutbound(self, stream: 'grpclib.server.Stream[app.proxyman.command.command_pb2.AddOutboundRequest, app.proxyman.command.command_pb2.AddOutboundResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def RemoveOutbound(self, stream: 'grpclib.server.Stream[app.proxyman.command.command_pb2.RemoveOutboundRequest, app.proxyman.command.command_pb2.RemoveOutboundResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def AlterOutbound(self, stream: 'grpclib.server.Stream[app.proxyman.command.command_pb2.AlterOutboundRequest, app.proxyman.command.command_pb2.AlterOutboundResponse]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/xray.app.proxyman.command.HandlerService/AddInbound': grpclib.const.Handler(
- self.AddInbound,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.proxyman.command.command_pb2.AddInboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AddInboundResponse,
- ),
- '/xray.app.proxyman.command.HandlerService/RemoveInbound': grpclib.const.Handler(
- self.RemoveInbound,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.proxyman.command.command_pb2.RemoveInboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.RemoveInboundResponse,
- ),
- '/xray.app.proxyman.command.HandlerService/AlterInbound': grpclib.const.Handler(
- self.AlterInbound,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.proxyman.command.command_pb2.AlterInboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AlterInboundResponse,
- ),
- '/xray.app.proxyman.command.HandlerService/AddOutbound': grpclib.const.Handler(
- self.AddOutbound,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.proxyman.command.command_pb2.AddOutboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AddOutboundResponse,
- ),
- '/xray.app.proxyman.command.HandlerService/RemoveOutbound': grpclib.const.Handler(
- self.RemoveOutbound,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.proxyman.command.command_pb2.RemoveOutboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.RemoveOutboundResponse,
- ),
- '/xray.app.proxyman.command.HandlerService/AlterOutbound': grpclib.const.Handler(
- self.AlterOutbound,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.proxyman.command.command_pb2.AlterOutboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AlterOutboundResponse,
- ),
- }
-
-
-class HandlerServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.AddInbound = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.proxyman.command.HandlerService/AddInbound',
- xray_api.proto.app.proxyman.command.command_pb2.AddInboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AddInboundResponse,
- )
- self.RemoveInbound = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.proxyman.command.HandlerService/RemoveInbound',
- xray_api.proto.app.proxyman.command.command_pb2.RemoveInboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.RemoveInboundResponse,
- )
- self.AlterInbound = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.proxyman.command.HandlerService/AlterInbound',
- xray_api.proto.app.proxyman.command.command_pb2.AlterInboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AlterInboundResponse,
- )
- self.AddOutbound = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.proxyman.command.HandlerService/AddOutbound',
- xray_api.proto.app.proxyman.command.command_pb2.AddOutboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AddOutboundResponse,
- )
- self.RemoveOutbound = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.proxyman.command.HandlerService/RemoveOutbound',
- xray_api.proto.app.proxyman.command.command_pb2.RemoveOutboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.RemoveOutboundResponse,
- )
- self.AlterOutbound = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.proxyman.command.HandlerService/AlterOutbound',
- xray_api.proto.app.proxyman.command.command_pb2.AlterOutboundRequest,
- xray_api.proto.app.proxyman.command.command_pb2.AlterOutboundResponse,
- )
diff --git a/xray_api/proto/app/proxyman/command/command_pb2.py b/xray_api/proto/app/proxyman/command/command_pb2.py
@@ -1,181 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/proxyman/command/command.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import user_pb2 as common_dot_protocol_dot_user__pb2
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-from xray_api.proto.core import config_pb2 as core_dot_config__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"app/proxyman/command/command.proto\x12\x19xray.app.proxyman.command\x1a\x1a\x63ommon/protocol/user.proto\x1a!common/serial/typed_message.proto\x1a\x11\x63ore/config.proto\"<\n\x10\x41\x64\x64UserOperation\x12(\n\x04user\x18\x01 \x01(\x0b\x32\x1a.xray.common.protocol.User\"$\n\x13RemoveUserOperation\x12\r\n\x05\x65mail\x18\x01 \x01(\t\"E\n\x11\x41\x64\x64InboundRequest\x12\x30\n\x07inbound\x18\x01 \x01(\x0b\x32\x1f.xray.core.InboundHandlerConfig\"\x14\n\x12\x41\x64\x64InboundResponse\"#\n\x14RemoveInboundRequest\x12\x0b\n\x03tag\x18\x01 \x01(\t\"\x17\n\x15RemoveInboundResponse\"W\n\x13\x41lterInboundRequest\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x33\n\toperation\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\"\x16\n\x14\x41lterInboundResponse\"H\n\x12\x41\x64\x64OutboundRequest\x12\x32\n\x08outbound\x18\x01 \x01(\x0b\x32 .xray.core.OutboundHandlerConfig\"\x15\n\x13\x41\x64\x64OutboundResponse\"$\n\x15RemoveOutboundRequest\x12\x0b\n\x03tag\x18\x01 \x01(\t\"\x18\n\x16RemoveOutboundResponse\"X\n\x14\x41lterOutboundRequest\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x33\n\toperation\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\"\x17\n\x15\x41lterOutboundResponse\"\x08\n\x06\x43onfig2\xc5\x05\n\x0eHandlerService\x12k\n\nAddInbound\x12,.xray.app.proxyman.command.AddInboundRequest\x1a-.xray.app.proxyman.command.AddInboundResponse\"\x00\x12t\n\rRemoveInbound\x12/.xray.app.proxyman.command.RemoveInboundRequest\x1a\x30.xray.app.proxyman.command.RemoveInboundResponse\"\x00\x12q\n\x0c\x41lterInbound\x12..xray.app.proxyman.command.AlterInboundRequest\x1a/.xray.app.proxyman.command.AlterInboundResponse\"\x00\x12n\n\x0b\x41\x64\x64Outbound\x12-.xray.app.proxyman.command.AddOutboundRequest\x1a..xray.app.proxyman.command.AddOutboundResponse\"\x00\x12w\n\x0eRemoveOutbound\x12\x30.xray.app.proxyman.command.RemoveOutboundRequest\x1a\x31.xray.app.proxyman.command.RemoveOutboundResponse\"\x00\x12t\n\rAlterOutbound\x12/.xray.app.proxyman.command.AlterOutboundRequest\x1a\x30.xray.app.proxyman.command.AlterOutboundResponse\"\x00\x42m\n\x1d\x63om.xray.app.proxyman.commandP\x01Z.github.com/xtls/xray-core/app/proxyman/command\xaa\x02\x19Xray.App.Proxyman.Commandb\x06proto3')
-
-
-
-_ADDUSEROPERATION = DESCRIPTOR.message_types_by_name['AddUserOperation']
-_REMOVEUSEROPERATION = DESCRIPTOR.message_types_by_name['RemoveUserOperation']
-_ADDINBOUNDREQUEST = DESCRIPTOR.message_types_by_name['AddInboundRequest']
-_ADDINBOUNDRESPONSE = DESCRIPTOR.message_types_by_name['AddInboundResponse']
-_REMOVEINBOUNDREQUEST = DESCRIPTOR.message_types_by_name['RemoveInboundRequest']
-_REMOVEINBOUNDRESPONSE = DESCRIPTOR.message_types_by_name['RemoveInboundResponse']
-_ALTERINBOUNDREQUEST = DESCRIPTOR.message_types_by_name['AlterInboundRequest']
-_ALTERINBOUNDRESPONSE = DESCRIPTOR.message_types_by_name['AlterInboundResponse']
-_ADDOUTBOUNDREQUEST = DESCRIPTOR.message_types_by_name['AddOutboundRequest']
-_ADDOUTBOUNDRESPONSE = DESCRIPTOR.message_types_by_name['AddOutboundResponse']
-_REMOVEOUTBOUNDREQUEST = DESCRIPTOR.message_types_by_name['RemoveOutboundRequest']
-_REMOVEOUTBOUNDRESPONSE = DESCRIPTOR.message_types_by_name['RemoveOutboundResponse']
-_ALTEROUTBOUNDREQUEST = DESCRIPTOR.message_types_by_name['AlterOutboundRequest']
-_ALTEROUTBOUNDRESPONSE = DESCRIPTOR.message_types_by_name['AlterOutboundResponse']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-AddUserOperation = _reflection.GeneratedProtocolMessageType('AddUserOperation', (_message.Message,), {
- 'DESCRIPTOR' : _ADDUSEROPERATION,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AddUserOperation)
- })
-_sym_db.RegisterMessage(AddUserOperation)
-
-RemoveUserOperation = _reflection.GeneratedProtocolMessageType('RemoveUserOperation', (_message.Message,), {
- 'DESCRIPTOR' : _REMOVEUSEROPERATION,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.RemoveUserOperation)
- })
-_sym_db.RegisterMessage(RemoveUserOperation)
-
-AddInboundRequest = _reflection.GeneratedProtocolMessageType('AddInboundRequest', (_message.Message,), {
- 'DESCRIPTOR' : _ADDINBOUNDREQUEST,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AddInboundRequest)
- })
-_sym_db.RegisterMessage(AddInboundRequest)
-
-AddInboundResponse = _reflection.GeneratedProtocolMessageType('AddInboundResponse', (_message.Message,), {
- 'DESCRIPTOR' : _ADDINBOUNDRESPONSE,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AddInboundResponse)
- })
-_sym_db.RegisterMessage(AddInboundResponse)
-
-RemoveInboundRequest = _reflection.GeneratedProtocolMessageType('RemoveInboundRequest', (_message.Message,), {
- 'DESCRIPTOR' : _REMOVEINBOUNDREQUEST,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.RemoveInboundRequest)
- })
-_sym_db.RegisterMessage(RemoveInboundRequest)
-
-RemoveInboundResponse = _reflection.GeneratedProtocolMessageType('RemoveInboundResponse', (_message.Message,), {
- 'DESCRIPTOR' : _REMOVEINBOUNDRESPONSE,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.RemoveInboundResponse)
- })
-_sym_db.RegisterMessage(RemoveInboundResponse)
-
-AlterInboundRequest = _reflection.GeneratedProtocolMessageType('AlterInboundRequest', (_message.Message,), {
- 'DESCRIPTOR' : _ALTERINBOUNDREQUEST,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AlterInboundRequest)
- })
-_sym_db.RegisterMessage(AlterInboundRequest)
-
-AlterInboundResponse = _reflection.GeneratedProtocolMessageType('AlterInboundResponse', (_message.Message,), {
- 'DESCRIPTOR' : _ALTERINBOUNDRESPONSE,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AlterInboundResponse)
- })
-_sym_db.RegisterMessage(AlterInboundResponse)
-
-AddOutboundRequest = _reflection.GeneratedProtocolMessageType('AddOutboundRequest', (_message.Message,), {
- 'DESCRIPTOR' : _ADDOUTBOUNDREQUEST,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AddOutboundRequest)
- })
-_sym_db.RegisterMessage(AddOutboundRequest)
-
-AddOutboundResponse = _reflection.GeneratedProtocolMessageType('AddOutboundResponse', (_message.Message,), {
- 'DESCRIPTOR' : _ADDOUTBOUNDRESPONSE,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AddOutboundResponse)
- })
-_sym_db.RegisterMessage(AddOutboundResponse)
-
-RemoveOutboundRequest = _reflection.GeneratedProtocolMessageType('RemoveOutboundRequest', (_message.Message,), {
- 'DESCRIPTOR' : _REMOVEOUTBOUNDREQUEST,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.RemoveOutboundRequest)
- })
-_sym_db.RegisterMessage(RemoveOutboundRequest)
-
-RemoveOutboundResponse = _reflection.GeneratedProtocolMessageType('RemoveOutboundResponse', (_message.Message,), {
- 'DESCRIPTOR' : _REMOVEOUTBOUNDRESPONSE,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.RemoveOutboundResponse)
- })
-_sym_db.RegisterMessage(RemoveOutboundResponse)
-
-AlterOutboundRequest = _reflection.GeneratedProtocolMessageType('AlterOutboundRequest', (_message.Message,), {
- 'DESCRIPTOR' : _ALTEROUTBOUNDREQUEST,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AlterOutboundRequest)
- })
-_sym_db.RegisterMessage(AlterOutboundRequest)
-
-AlterOutboundResponse = _reflection.GeneratedProtocolMessageType('AlterOutboundResponse', (_message.Message,), {
- 'DESCRIPTOR' : _ALTEROUTBOUNDRESPONSE,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.AlterOutboundResponse)
- })
-_sym_db.RegisterMessage(AlterOutboundResponse)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.proxyman.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.command.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-_HANDLERSERVICE = DESCRIPTOR.services_by_name['HandlerService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\035com.xray.app.proxyman.commandP\001Z.github.com/xtls/xray-core/app/proxyman/command\252\002\031Xray.App.Proxyman.Command'
- _ADDUSEROPERATION._serialized_start=147
- _ADDUSEROPERATION._serialized_end=207
- _REMOVEUSEROPERATION._serialized_start=209
- _REMOVEUSEROPERATION._serialized_end=245
- _ADDINBOUNDREQUEST._serialized_start=247
- _ADDINBOUNDREQUEST._serialized_end=316
- _ADDINBOUNDRESPONSE._serialized_start=318
- _ADDINBOUNDRESPONSE._serialized_end=338
- _REMOVEINBOUNDREQUEST._serialized_start=340
- _REMOVEINBOUNDREQUEST._serialized_end=375
- _REMOVEINBOUNDRESPONSE._serialized_start=377
- _REMOVEINBOUNDRESPONSE._serialized_end=400
- _ALTERINBOUNDREQUEST._serialized_start=402
- _ALTERINBOUNDREQUEST._serialized_end=489
- _ALTERINBOUNDRESPONSE._serialized_start=491
- _ALTERINBOUNDRESPONSE._serialized_end=513
- _ADDOUTBOUNDREQUEST._serialized_start=515
- _ADDOUTBOUNDREQUEST._serialized_end=587
- _ADDOUTBOUNDRESPONSE._serialized_start=589
- _ADDOUTBOUNDRESPONSE._serialized_end=610
- _REMOVEOUTBOUNDREQUEST._serialized_start=612
- _REMOVEOUTBOUNDREQUEST._serialized_end=648
- _REMOVEOUTBOUNDRESPONSE._serialized_start=650
- _REMOVEOUTBOUNDRESPONSE._serialized_end=674
- _ALTEROUTBOUNDREQUEST._serialized_start=676
- _ALTEROUTBOUNDREQUEST._serialized_end=764
- _ALTEROUTBOUNDRESPONSE._serialized_start=766
- _ALTEROUTBOUNDRESPONSE._serialized_end=789
- _CONFIG._serialized_start=791
- _CONFIG._serialized_end=799
- _HANDLERSERVICE._serialized_start=802
- _HANDLERSERVICE._serialized_end=1511
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/proxyman/config_grpc.py b/xray_api/proto/app/proxyman/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/proxyman/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/proxyman/config_pb2.py b/xray_api/proto/app/proxyman/config_pb2.py
@@ -1,143 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/proxyman/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-from xray_api.proto.common.net import port_pb2 as common_dot_net_dot_port__pb2
-from xray_api.proto.transport.internet import config_pb2 as transport_dot_internet_dot_config__pb2
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x61pp/proxyman/config.proto\x12\x11xray.app.proxyman\x1a\x18\x63ommon/net/address.proto\x1a\x15\x63ommon/net/port.proto\x1a\x1ftransport/internet/config.proto\x1a!common/serial/typed_message.proto\"\x0f\n\rInboundConfig\"\x84\x03\n\x12\x41llocationStrategy\x12\x38\n\x04type\x18\x01 \x01(\x0e\x32*.xray.app.proxyman.AllocationStrategy.Type\x12X\n\x0b\x63oncurrency\x18\x02 \x01(\x0b\x32\x43.xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency\x12P\n\x07refresh\x18\x03 \x01(\x0b\x32?.xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh\x1a.\n\x1d\x41llocationStrategyConcurrency\x12\r\n\x05value\x18\x01 \x01(\r\x1a*\n\x19\x41llocationStrategyRefresh\x12\r\n\x05value\x18\x01 \x01(\r\",\n\x04Type\x12\n\n\x06\x41lways\x10\x00\x12\n\n\x06Random\x10\x01\x12\x0c\n\x08\x45xternal\x10\x02\"\x84\x01\n\x0eSniffingConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x1c\n\x14\x64\x65stination_override\x18\x02 \x03(\t\x12\x18\n\x10\x64omains_excluded\x18\x03 \x03(\t\x12\x15\n\rmetadata_only\x18\x04 \x01(\x08\x12\x12\n\nroute_only\x18\x05 \x01(\x08\"\x99\x03\n\x0eReceiverConfig\x12,\n\tport_list\x18\x01 \x01(\x0b\x32\x19.xray.common.net.PortList\x12+\n\x06listen\x18\x02 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x42\n\x13\x61llocation_strategy\x18\x03 \x01(\x0b\x32%.xray.app.proxyman.AllocationStrategy\x12>\n\x0fstream_settings\x18\x04 \x01(\x0b\x32%.xray.transport.internet.StreamConfig\x12$\n\x1creceive_original_destination\x18\x05 \x01(\x08\x12>\n\x0f\x64omain_override\x18\x07 \x03(\x0e\x32!.xray.app.proxyman.KnownProtocolsB\x02\x18\x01\x12<\n\x11sniffing_settings\x18\x08 \x01(\x0b\x32!.xray.app.proxyman.SniffingConfigJ\x04\x08\x06\x10\x07\"\x9a\x01\n\x14InboundHandlerConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12;\n\x11receiver_settings\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x38\n\x0eproxy_settings\x18\x03 \x01(\x0b\x32 .xray.common.serial.TypedMessage\"\x10\n\x0eOutboundConfig\"\xf9\x01\n\x0cSenderConfig\x12(\n\x03via\x18\x01 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12>\n\x0fstream_settings\x18\x02 \x01(\x0b\x32%.xray.transport.internet.StreamConfig\x12<\n\x0eproxy_settings\x18\x03 \x01(\x0b\x32$.xray.transport.internet.ProxyConfig\x12\x41\n\x12multiplex_settings\x18\x04 \x01(\x0b\x32%.xray.app.proxyman.MultiplexingConfig\"l\n\x12MultiplexingConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x13\n\x0b\x63oncurrency\x18\x02 \x01(\x05\x12\x17\n\x0fxudpConcurrency\x18\x03 \x01(\x05\x12\x17\n\x0fxudpProxyUDP443\x18\x04 \x01(\t*#\n\x0eKnownProtocols\x12\x08\n\x04HTTP\x10\x00\x12\x07\n\x03TLS\x10\x01\x42U\n\x15\x63om.xray.app.proxymanP\x01Z&github.com/xtls/xray-core/app/proxyman\xaa\x02\x11Xray.App.Proxymanb\x06proto3')
-
-_KNOWNPROTOCOLS = DESCRIPTOR.enum_types_by_name['KnownProtocols']
-KnownProtocols = enum_type_wrapper.EnumTypeWrapper(_KNOWNPROTOCOLS)
-HTTP = 0
-TLS = 1
-
-
-_INBOUNDCONFIG = DESCRIPTOR.message_types_by_name['InboundConfig']
-_ALLOCATIONSTRATEGY = DESCRIPTOR.message_types_by_name['AllocationStrategy']
-_ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYCONCURRENCY = _ALLOCATIONSTRATEGY.nested_types_by_name['AllocationStrategyConcurrency']
-_ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYREFRESH = _ALLOCATIONSTRATEGY.nested_types_by_name['AllocationStrategyRefresh']
-_SNIFFINGCONFIG = DESCRIPTOR.message_types_by_name['SniffingConfig']
-_RECEIVERCONFIG = DESCRIPTOR.message_types_by_name['ReceiverConfig']
-_INBOUNDHANDLERCONFIG = DESCRIPTOR.message_types_by_name['InboundHandlerConfig']
-_OUTBOUNDCONFIG = DESCRIPTOR.message_types_by_name['OutboundConfig']
-_SENDERCONFIG = DESCRIPTOR.message_types_by_name['SenderConfig']
-_MULTIPLEXINGCONFIG = DESCRIPTOR.message_types_by_name['MultiplexingConfig']
-_ALLOCATIONSTRATEGY_TYPE = _ALLOCATIONSTRATEGY.enum_types_by_name['Type']
-InboundConfig = _reflection.GeneratedProtocolMessageType('InboundConfig', (_message.Message,), {
- 'DESCRIPTOR' : _INBOUNDCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.InboundConfig)
- })
-_sym_db.RegisterMessage(InboundConfig)
-
-AllocationStrategy = _reflection.GeneratedProtocolMessageType('AllocationStrategy', (_message.Message,), {
-
- 'AllocationStrategyConcurrency' : _reflection.GeneratedProtocolMessageType('AllocationStrategyConcurrency', (_message.Message,), {
- 'DESCRIPTOR' : _ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYCONCURRENCY,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency)
- })
- ,
-
- 'AllocationStrategyRefresh' : _reflection.GeneratedProtocolMessageType('AllocationStrategyRefresh', (_message.Message,), {
- 'DESCRIPTOR' : _ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYREFRESH,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.AllocationStrategy.AllocationStrategyRefresh)
- })
- ,
- 'DESCRIPTOR' : _ALLOCATIONSTRATEGY,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.AllocationStrategy)
- })
-_sym_db.RegisterMessage(AllocationStrategy)
-_sym_db.RegisterMessage(AllocationStrategy.AllocationStrategyConcurrency)
-_sym_db.RegisterMessage(AllocationStrategy.AllocationStrategyRefresh)
-
-SniffingConfig = _reflection.GeneratedProtocolMessageType('SniffingConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SNIFFINGCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.SniffingConfig)
- })
-_sym_db.RegisterMessage(SniffingConfig)
-
-ReceiverConfig = _reflection.GeneratedProtocolMessageType('ReceiverConfig', (_message.Message,), {
- 'DESCRIPTOR' : _RECEIVERCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.ReceiverConfig)
- })
-_sym_db.RegisterMessage(ReceiverConfig)
-
-InboundHandlerConfig = _reflection.GeneratedProtocolMessageType('InboundHandlerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _INBOUNDHANDLERCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.InboundHandlerConfig)
- })
-_sym_db.RegisterMessage(InboundHandlerConfig)
-
-OutboundConfig = _reflection.GeneratedProtocolMessageType('OutboundConfig', (_message.Message,), {
- 'DESCRIPTOR' : _OUTBOUNDCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.OutboundConfig)
- })
-_sym_db.RegisterMessage(OutboundConfig)
-
-SenderConfig = _reflection.GeneratedProtocolMessageType('SenderConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SENDERCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.SenderConfig)
- })
-_sym_db.RegisterMessage(SenderConfig)
-
-MultiplexingConfig = _reflection.GeneratedProtocolMessageType('MultiplexingConfig', (_message.Message,), {
- 'DESCRIPTOR' : _MULTIPLEXINGCONFIG,
- '__module__' : 'app.proxyman.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.proxyman.MultiplexingConfig)
- })
-_sym_db.RegisterMessage(MultiplexingConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\025com.xray.app.proxymanP\001Z&github.com/xtls/xray-core/app/proxyman\252\002\021Xray.App.Proxyman'
- _RECEIVERCONFIG.fields_by_name['domain_override']._options = None
- _RECEIVERCONFIG.fields_by_name['domain_override']._serialized_options = b'\030\001'
- _KNOWNPROTOCOLS._serialized_start=1657
- _KNOWNPROTOCOLS._serialized_end=1692
- _INBOUNDCONFIG._serialized_start=165
- _INBOUNDCONFIG._serialized_end=180
- _ALLOCATIONSTRATEGY._serialized_start=183
- _ALLOCATIONSTRATEGY._serialized_end=571
- _ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYCONCURRENCY._serialized_start=435
- _ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYCONCURRENCY._serialized_end=481
- _ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYREFRESH._serialized_start=483
- _ALLOCATIONSTRATEGY_ALLOCATIONSTRATEGYREFRESH._serialized_end=525
- _ALLOCATIONSTRATEGY_TYPE._serialized_start=527
- _ALLOCATIONSTRATEGY_TYPE._serialized_end=571
- _SNIFFINGCONFIG._serialized_start=574
- _SNIFFINGCONFIG._serialized_end=706
- _RECEIVERCONFIG._serialized_start=709
- _RECEIVERCONFIG._serialized_end=1118
- _INBOUNDHANDLERCONFIG._serialized_start=1121
- _INBOUNDHANDLERCONFIG._serialized_end=1275
- _OUTBOUNDCONFIG._serialized_start=1277
- _OUTBOUNDCONFIG._serialized_end=1293
- _SENDERCONFIG._serialized_start=1296
- _SENDERCONFIG._serialized_end=1545
- _MULTIPLEXINGCONFIG._serialized_start=1547
- _MULTIPLEXINGCONFIG._serialized_end=1655
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/reverse/config_grpc.py b/xray_api/proto/app/reverse/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/reverse/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/reverse/config_pb2.py b/xray_api/proto/app/reverse/config_pb2.py
@@ -1,68 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/reverse/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x61pp/reverse/config.proto\x12\x10xray.app.reverse\"i\n\x07\x43ontrol\x12.\n\x05state\x18\x01 \x01(\x0e\x32\x1f.xray.app.reverse.Control.State\x12\x0e\n\x06random\x18\x63 \x01(\x0c\"\x1e\n\x05State\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\t\n\x05\x44RAIN\x10\x01\"+\n\x0c\x42ridgeConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\"+\n\x0cPortalConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\"v\n\x06\x43onfig\x12\x35\n\rbridge_config\x18\x01 \x03(\x0b\x32\x1e.xray.app.reverse.BridgeConfig\x12\x35\n\rportal_config\x18\x02 \x03(\x0b\x32\x1e.xray.app.reverse.PortalConfigBV\n\x16\x63om.xray.proxy.reverseP\x01Z%github.com/xtls/xray-core/app/reverse\xaa\x02\x12Xray.Proxy.Reverseb\x06proto3')
-
-
-
-_CONTROL = DESCRIPTOR.message_types_by_name['Control']
-_BRIDGECONFIG = DESCRIPTOR.message_types_by_name['BridgeConfig']
-_PORTALCONFIG = DESCRIPTOR.message_types_by_name['PortalConfig']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CONTROL_STATE = _CONTROL.enum_types_by_name['State']
-Control = _reflection.GeneratedProtocolMessageType('Control', (_message.Message,), {
- 'DESCRIPTOR' : _CONTROL,
- '__module__' : 'app.reverse.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.reverse.Control)
- })
-_sym_db.RegisterMessage(Control)
-
-BridgeConfig = _reflection.GeneratedProtocolMessageType('BridgeConfig', (_message.Message,), {
- 'DESCRIPTOR' : _BRIDGECONFIG,
- '__module__' : 'app.reverse.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.reverse.BridgeConfig)
- })
-_sym_db.RegisterMessage(BridgeConfig)
-
-PortalConfig = _reflection.GeneratedProtocolMessageType('PortalConfig', (_message.Message,), {
- 'DESCRIPTOR' : _PORTALCONFIG,
- '__module__' : 'app.reverse.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.reverse.PortalConfig)
- })
-_sym_db.RegisterMessage(PortalConfig)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.reverse.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.reverse.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\026com.xray.proxy.reverseP\001Z%github.com/xtls/xray-core/app/reverse\252\002\022Xray.Proxy.Reverse'
- _CONTROL._serialized_start=46
- _CONTROL._serialized_end=151
- _CONTROL_STATE._serialized_start=121
- _CONTROL_STATE._serialized_end=151
- _BRIDGECONFIG._serialized_start=153
- _BRIDGECONFIG._serialized_end=196
- _PORTALCONFIG._serialized_start=198
- _PORTALCONFIG._serialized_end=241
- _CONFIG._serialized_start=243
- _CONFIG._serialized_end=361
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/router/command/command_grpc.py b/xray_api/proto/app/router/command/command_grpc.py
@@ -1,57 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/router/command/command.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import xray_api.proto.common.net.network_pb2
-import xray_api.proto.app.router.command.command_pb2
-
-
-class RoutingServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def SubscribeRoutingStats(self, stream: 'grpclib.server.Stream[app.router.command.command_pb2.SubscribeRoutingStatsRequest, app.router.command.command_pb2.RoutingContext]') -> None:
- pass
-
- @abc.abstractmethod
- async def TestRoute(self, stream: 'grpclib.server.Stream[app.router.command.command_pb2.TestRouteRequest, app.router.command.command_pb2.RoutingContext]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/xray.app.router.command.RoutingService/SubscribeRoutingStats': grpclib.const.Handler(
- self.SubscribeRoutingStats,
- grpclib.const.Cardinality.UNARY_STREAM,
- xray_api.proto.app.router.command.command_pb2.SubscribeRoutingStatsRequest,
- xray_api.proto.app.router.command.command_pb2.RoutingContext,
- ),
- '/xray.app.router.command.RoutingService/TestRoute': grpclib.const.Handler(
- self.TestRoute,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.router.command.command_pb2.TestRouteRequest,
- xray_api.proto.app.router.command.command_pb2.RoutingContext,
- ),
- }
-
-
-class RoutingServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.SubscribeRoutingStats = grpclib.client.UnaryStreamMethod(
- channel,
- '/xray.app.router.command.RoutingService/SubscribeRoutingStats',
- xray_api.proto.app.router.command.command_pb2.SubscribeRoutingStatsRequest,
- xray_api.proto.app.router.command.command_pb2.RoutingContext,
- )
- self.TestRoute = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.router.command.RoutingService/TestRoute',
- xray_api.proto.app.router.command.command_pb2.TestRouteRequest,
- xray_api.proto.app.router.command.command_pb2.RoutingContext,
- )
diff --git a/xray_api/proto/app/router/command/command_pb2.py b/xray_api/proto/app/router/command/command_pb2.py
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/router/command/command.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import network_pb2 as common_dot_net_dot_network__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n app/router/command/command.proto\x12\x17xray.app.router.command\x1a\x18\x63ommon/net/network.proto\"\x83\x03\n\x0eRoutingContext\x12\x12\n\nInboundTag\x18\x01 \x01(\t\x12)\n\x07Network\x18\x02 \x01(\x0e\x32\x18.xray.common.net.Network\x12\x11\n\tSourceIPs\x18\x03 \x03(\x0c\x12\x11\n\tTargetIPs\x18\x04 \x03(\x0c\x12\x12\n\nSourcePort\x18\x05 \x01(\r\x12\x12\n\nTargetPort\x18\x06 \x01(\r\x12\x14\n\x0cTargetDomain\x18\x07 \x01(\t\x12\x10\n\x08Protocol\x18\x08 \x01(\t\x12\x0c\n\x04User\x18\t \x01(\t\x12K\n\nAttributes\x18\n \x03(\x0b\x32\x37.xray.app.router.command.RoutingContext.AttributesEntry\x12\x19\n\x11OutboundGroupTags\x18\x0b \x03(\t\x12\x13\n\x0bOutboundTag\x18\x0c \x01(\t\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x1cSubscribeRoutingStatsRequest\x12\x16\n\x0e\x46ieldSelectors\x18\x01 \x03(\t\"\x82\x01\n\x10TestRouteRequest\x12?\n\x0eRoutingContext\x18\x01 \x01(\x0b\x32\'.xray.app.router.command.RoutingContext\x12\x16\n\x0e\x46ieldSelectors\x18\x02 \x03(\t\x12\x15\n\rPublishResult\x18\x03 \x01(\x08\"\x08\n\x06\x43onfig2\xf0\x01\n\x0eRoutingService\x12{\n\x15SubscribeRoutingStats\x12\x35.xray.app.router.command.SubscribeRoutingStatsRequest\x1a\'.xray.app.router.command.RoutingContext\"\x00\x30\x01\x12\x61\n\tTestRoute\x12).xray.app.router.command.TestRouteRequest\x1a\'.xray.app.router.command.RoutingContext\"\x00\x42g\n\x1b\x63om.xray.app.router.commandP\x01Z,github.com/xtls/xray-core/app/router/command\xaa\x02\x17Xray.App.Router.Commandb\x06proto3')
-
-
-
-_ROUTINGCONTEXT = DESCRIPTOR.message_types_by_name['RoutingContext']
-_ROUTINGCONTEXT_ATTRIBUTESENTRY = _ROUTINGCONTEXT.nested_types_by_name['AttributesEntry']
-_SUBSCRIBEROUTINGSTATSREQUEST = DESCRIPTOR.message_types_by_name['SubscribeRoutingStatsRequest']
-_TESTROUTEREQUEST = DESCRIPTOR.message_types_by_name['TestRouteRequest']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-RoutingContext = _reflection.GeneratedProtocolMessageType('RoutingContext', (_message.Message,), {
-
- 'AttributesEntry' : _reflection.GeneratedProtocolMessageType('AttributesEntry', (_message.Message,), {
- 'DESCRIPTOR' : _ROUTINGCONTEXT_ATTRIBUTESENTRY,
- '__module__' : 'app.router.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.command.RoutingContext.AttributesEntry)
- })
- ,
- 'DESCRIPTOR' : _ROUTINGCONTEXT,
- '__module__' : 'app.router.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.command.RoutingContext)
- })
-_sym_db.RegisterMessage(RoutingContext)
-_sym_db.RegisterMessage(RoutingContext.AttributesEntry)
-
-SubscribeRoutingStatsRequest = _reflection.GeneratedProtocolMessageType('SubscribeRoutingStatsRequest', (_message.Message,), {
- 'DESCRIPTOR' : _SUBSCRIBEROUTINGSTATSREQUEST,
- '__module__' : 'app.router.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.command.SubscribeRoutingStatsRequest)
- })
-_sym_db.RegisterMessage(SubscribeRoutingStatsRequest)
-
-TestRouteRequest = _reflection.GeneratedProtocolMessageType('TestRouteRequest', (_message.Message,), {
- 'DESCRIPTOR' : _TESTROUTEREQUEST,
- '__module__' : 'app.router.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.command.TestRouteRequest)
- })
-_sym_db.RegisterMessage(TestRouteRequest)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.router.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.command.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-_ROUTINGSERVICE = DESCRIPTOR.services_by_name['RoutingService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\033com.xray.app.router.commandP\001Z,github.com/xtls/xray-core/app/router/command\252\002\027Xray.App.Router.Command'
- _ROUTINGCONTEXT_ATTRIBUTESENTRY._options = None
- _ROUTINGCONTEXT_ATTRIBUTESENTRY._serialized_options = b'8\001'
- _ROUTINGCONTEXT._serialized_start=88
- _ROUTINGCONTEXT._serialized_end=475
- _ROUTINGCONTEXT_ATTRIBUTESENTRY._serialized_start=426
- _ROUTINGCONTEXT_ATTRIBUTESENTRY._serialized_end=475
- _SUBSCRIBEROUTINGSTATSREQUEST._serialized_start=477
- _SUBSCRIBEROUTINGSTATSREQUEST._serialized_end=531
- _TESTROUTEREQUEST._serialized_start=534
- _TESTROUTEREQUEST._serialized_end=664
- _CONFIG._serialized_start=666
- _CONFIG._serialized_end=674
- _ROUTINGSERVICE._serialized_start=677
- _ROUTINGSERVICE._serialized_end=917
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/router/config_grpc.py b/xray_api/proto/app/router/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/router/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/router/config_pb2.py b/xray_api/proto/app/router/config_pb2.py
@@ -1,155 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/router/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import port_pb2 as common_dot_net_dot_port__pb2
-from xray_api.proto.common.net import network_pb2 as common_dot_net_dot_network__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17\x61pp/router/config.proto\x12\x0fxray.app.router\x1a\x15\x63ommon/net/port.proto\x1a\x18\x63ommon/net/network.proto\"\x81\x02\n\x06\x44omain\x12*\n\x04type\x18\x01 \x01(\x0e\x32\x1c.xray.app.router.Domain.Type\x12\r\n\x05value\x18\x02 \x01(\t\x12\x34\n\tattribute\x18\x03 \x03(\x0b\x32!.xray.app.router.Domain.Attribute\x1aR\n\tAttribute\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x42\r\n\x0btyped_value\"2\n\x04Type\x12\t\n\x05Plain\x10\x00\x12\t\n\x05Regex\x10\x01\x12\n\n\x06\x44omain\x10\x02\x12\x08\n\x04\x46ull\x10\x03\"\"\n\x04\x43IDR\x12\n\n\x02ip\x18\x01 \x01(\x0c\x12\x0e\n\x06prefix\x18\x02 \x01(\r\"Y\n\x05GeoIP\x12\x14\n\x0c\x63ountry_code\x18\x01 \x01(\t\x12#\n\x04\x63idr\x18\x02 \x03(\x0b\x32\x15.xray.app.router.CIDR\x12\x15\n\rreverse_match\x18\x03 \x01(\x08\"2\n\tGeoIPList\x12%\n\x05\x65ntry\x18\x01 \x03(\x0b\x32\x16.xray.app.router.GeoIP\"H\n\x07GeoSite\x12\x14\n\x0c\x63ountry_code\x18\x01 \x01(\t\x12\'\n\x06\x64omain\x18\x02 \x03(\x0b\x32\x17.xray.app.router.Domain\"6\n\x0bGeoSiteList\x12\'\n\x05\x65ntry\x18\x01 \x03(\x0b\x32\x18.xray.app.router.GeoSite\"\xdd\x05\n\x0bRoutingRule\x12\r\n\x03tag\x18\x01 \x01(\tH\x00\x12\x17\n\rbalancing_tag\x18\x0c \x01(\tH\x00\x12\'\n\x06\x64omain\x18\x02 \x03(\x0b\x32\x17.xray.app.router.Domain\x12\'\n\x04\x63idr\x18\x03 \x03(\x0b\x32\x15.xray.app.router.CIDRB\x02\x18\x01\x12%\n\x05geoip\x18\n \x03(\x0b\x32\x16.xray.app.router.GeoIP\x12\x32\n\nport_range\x18\x04 \x01(\x0b\x32\x1a.xray.common.net.PortRangeB\x02\x18\x01\x12,\n\tport_list\x18\x0e \x01(\x0b\x32\x19.xray.common.net.PortList\x12\x36\n\x0cnetwork_list\x18\x05 \x01(\x0b\x32\x1c.xray.common.net.NetworkListB\x02\x18\x01\x12*\n\x08networks\x18\r \x03(\x0e\x32\x18.xray.common.net.Network\x12.\n\x0bsource_cidr\x18\x06 \x03(\x0b\x32\x15.xray.app.router.CIDRB\x02\x18\x01\x12,\n\x0csource_geoip\x18\x0b \x03(\x0b\x32\x16.xray.app.router.GeoIP\x12\x33\n\x10source_port_list\x18\x10 \x01(\x0b\x32\x19.xray.common.net.PortList\x12\x12\n\nuser_email\x18\x07 \x03(\t\x12\x13\n\x0binbound_tag\x18\x08 \x03(\t\x12\x10\n\x08protocol\x18\t \x03(\t\x12@\n\nattributes\x18\x0f \x03(\x0b\x32,.xray.app.router.RoutingRule.AttributesEntry\x12\x16\n\x0e\x64omain_matcher\x18\x11 \x01(\t\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0c\n\ntarget_tag\"I\n\rBalancingRule\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x19\n\x11outbound_selector\x18\x02 \x03(\t\x12\x10\n\x08strategy\x18\x03 \x01(\t\"\xf6\x01\n\x06\x43onfig\x12?\n\x0f\x64omain_strategy\x18\x01 \x01(\x0e\x32&.xray.app.router.Config.DomainStrategy\x12*\n\x04rule\x18\x02 \x03(\x0b\x32\x1c.xray.app.router.RoutingRule\x12\x36\n\x0e\x62\x61lancing_rule\x18\x03 \x03(\x0b\x32\x1e.xray.app.router.BalancingRule\"G\n\x0e\x44omainStrategy\x12\x08\n\x04\x41sIs\x10\x00\x12\t\n\x05UseIp\x10\x01\x12\x10\n\x0cIpIfNonMatch\x10\x02\x12\x0e\n\nIpOnDemand\x10\x03\x42O\n\x13\x63om.xray.app.routerP\x01Z$github.com/xtls/xray-core/app/router\xaa\x02\x0fXray.App.Routerb\x06proto3')
-
-
-
-_DOMAIN = DESCRIPTOR.message_types_by_name['Domain']
-_DOMAIN_ATTRIBUTE = _DOMAIN.nested_types_by_name['Attribute']
-_CIDR = DESCRIPTOR.message_types_by_name['CIDR']
-_GEOIP = DESCRIPTOR.message_types_by_name['GeoIP']
-_GEOIPLIST = DESCRIPTOR.message_types_by_name['GeoIPList']
-_GEOSITE = DESCRIPTOR.message_types_by_name['GeoSite']
-_GEOSITELIST = DESCRIPTOR.message_types_by_name['GeoSiteList']
-_ROUTINGRULE = DESCRIPTOR.message_types_by_name['RoutingRule']
-_ROUTINGRULE_ATTRIBUTESENTRY = _ROUTINGRULE.nested_types_by_name['AttributesEntry']
-_BALANCINGRULE = DESCRIPTOR.message_types_by_name['BalancingRule']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_DOMAIN_TYPE = _DOMAIN.enum_types_by_name['Type']
-_CONFIG_DOMAINSTRATEGY = _CONFIG.enum_types_by_name['DomainStrategy']
-Domain = _reflection.GeneratedProtocolMessageType('Domain', (_message.Message,), {
-
- 'Attribute' : _reflection.GeneratedProtocolMessageType('Attribute', (_message.Message,), {
- 'DESCRIPTOR' : _DOMAIN_ATTRIBUTE,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.Domain.Attribute)
- })
- ,
- 'DESCRIPTOR' : _DOMAIN,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.Domain)
- })
-_sym_db.RegisterMessage(Domain)
-_sym_db.RegisterMessage(Domain.Attribute)
-
-CIDR = _reflection.GeneratedProtocolMessageType('CIDR', (_message.Message,), {
- 'DESCRIPTOR' : _CIDR,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.CIDR)
- })
-_sym_db.RegisterMessage(CIDR)
-
-GeoIP = _reflection.GeneratedProtocolMessageType('GeoIP', (_message.Message,), {
- 'DESCRIPTOR' : _GEOIP,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.GeoIP)
- })
-_sym_db.RegisterMessage(GeoIP)
-
-GeoIPList = _reflection.GeneratedProtocolMessageType('GeoIPList', (_message.Message,), {
- 'DESCRIPTOR' : _GEOIPLIST,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.GeoIPList)
- })
-_sym_db.RegisterMessage(GeoIPList)
-
-GeoSite = _reflection.GeneratedProtocolMessageType('GeoSite', (_message.Message,), {
- 'DESCRIPTOR' : _GEOSITE,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.GeoSite)
- })
-_sym_db.RegisterMessage(GeoSite)
-
-GeoSiteList = _reflection.GeneratedProtocolMessageType('GeoSiteList', (_message.Message,), {
- 'DESCRIPTOR' : _GEOSITELIST,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.GeoSiteList)
- })
-_sym_db.RegisterMessage(GeoSiteList)
-
-RoutingRule = _reflection.GeneratedProtocolMessageType('RoutingRule', (_message.Message,), {
-
- 'AttributesEntry' : _reflection.GeneratedProtocolMessageType('AttributesEntry', (_message.Message,), {
- 'DESCRIPTOR' : _ROUTINGRULE_ATTRIBUTESENTRY,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.RoutingRule.AttributesEntry)
- })
- ,
- 'DESCRIPTOR' : _ROUTINGRULE,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.RoutingRule)
- })
-_sym_db.RegisterMessage(RoutingRule)
-_sym_db.RegisterMessage(RoutingRule.AttributesEntry)
-
-BalancingRule = _reflection.GeneratedProtocolMessageType('BalancingRule', (_message.Message,), {
- 'DESCRIPTOR' : _BALANCINGRULE,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.BalancingRule)
- })
-_sym_db.RegisterMessage(BalancingRule)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.router.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.router.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.app.routerP\001Z$github.com/xtls/xray-core/app/router\252\002\017Xray.App.Router'
- _ROUTINGRULE_ATTRIBUTESENTRY._options = None
- _ROUTINGRULE_ATTRIBUTESENTRY._serialized_options = b'8\001'
- _ROUTINGRULE.fields_by_name['cidr']._options = None
- _ROUTINGRULE.fields_by_name['cidr']._serialized_options = b'\030\001'
- _ROUTINGRULE.fields_by_name['port_range']._options = None
- _ROUTINGRULE.fields_by_name['port_range']._serialized_options = b'\030\001'
- _ROUTINGRULE.fields_by_name['network_list']._options = None
- _ROUTINGRULE.fields_by_name['network_list']._serialized_options = b'\030\001'
- _ROUTINGRULE.fields_by_name['source_cidr']._options = None
- _ROUTINGRULE.fields_by_name['source_cidr']._serialized_options = b'\030\001'
- _DOMAIN._serialized_start=94
- _DOMAIN._serialized_end=351
- _DOMAIN_ATTRIBUTE._serialized_start=217
- _DOMAIN_ATTRIBUTE._serialized_end=299
- _DOMAIN_TYPE._serialized_start=301
- _DOMAIN_TYPE._serialized_end=351
- _CIDR._serialized_start=353
- _CIDR._serialized_end=387
- _GEOIP._serialized_start=389
- _GEOIP._serialized_end=478
- _GEOIPLIST._serialized_start=480
- _GEOIPLIST._serialized_end=530
- _GEOSITE._serialized_start=532
- _GEOSITE._serialized_end=604
- _GEOSITELIST._serialized_start=606
- _GEOSITELIST._serialized_end=660
- _ROUTINGRULE._serialized_start=663
- _ROUTINGRULE._serialized_end=1396
- _ROUTINGRULE_ATTRIBUTESENTRY._serialized_start=1333
- _ROUTINGRULE_ATTRIBUTESENTRY._serialized_end=1382
- _BALANCINGRULE._serialized_start=1398
- _BALANCINGRULE._serialized_end=1471
- _CONFIG._serialized_start=1474
- _CONFIG._serialized_end=1720
- _CONFIG_DOMAINSTRATEGY._serialized_start=1649
- _CONFIG_DOMAINSTRATEGY._serialized_end=1720
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/stats/command/command_grpc.py b/xray_api/proto/app/stats/command/command_grpc.py
@@ -1,72 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/stats/command/command.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import xray_api.proto.app.stats.command.command_pb2
-
-
-class StatsServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def GetStats(self, stream: 'grpclib.server.Stream[app.stats.command.command_pb2.GetStatsRequest, app.stats.command.command_pb2.GetStatsResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def QueryStats(self, stream: 'grpclib.server.Stream[app.stats.command.command_pb2.QueryStatsRequest, app.stats.command.command_pb2.QueryStatsResponse]') -> None:
- pass
-
- @abc.abstractmethod
- async def GetSysStats(self, stream: 'grpclib.server.Stream[app.stats.command.command_pb2.SysStatsRequest, app.stats.command.command_pb2.SysStatsResponse]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/xray.app.stats.command.StatsService/GetStats': grpclib.const.Handler(
- self.GetStats,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.stats.command.command_pb2.GetStatsRequest,
- xray_api.proto.app.stats.command.command_pb2.GetStatsResponse,
- ),
- '/xray.app.stats.command.StatsService/QueryStats': grpclib.const.Handler(
- self.QueryStats,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.stats.command.command_pb2.QueryStatsRequest,
- xray_api.proto.app.stats.command.command_pb2.QueryStatsResponse,
- ),
- '/xray.app.stats.command.StatsService/GetSysStats': grpclib.const.Handler(
- self.GetSysStats,
- grpclib.const.Cardinality.UNARY_UNARY,
- xray_api.proto.app.stats.command.command_pb2.SysStatsRequest,
- xray_api.proto.app.stats.command.command_pb2.SysStatsResponse,
- ),
- }
-
-
-class StatsServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.GetStats = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.stats.command.StatsService/GetStats',
- xray_api.proto.app.stats.command.command_pb2.GetStatsRequest,
- xray_api.proto.app.stats.command.command_pb2.GetStatsResponse,
- )
- self.QueryStats = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.stats.command.StatsService/QueryStats',
- xray_api.proto.app.stats.command.command_pb2.QueryStatsRequest,
- xray_api.proto.app.stats.command.command_pb2.QueryStatsResponse,
- )
- self.GetSysStats = grpclib.client.UnaryUnaryMethod(
- channel,
- '/xray.app.stats.command.StatsService/GetSysStats',
- xray_api.proto.app.stats.command.command_pb2.SysStatsRequest,
- xray_api.proto.app.stats.command.command_pb2.SysStatsResponse,
- )
diff --git a/xray_api/proto/app/stats/command/command_pb2.py b/xray_api/proto/app/stats/command/command_pb2.py
@@ -1,108 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/stats/command/command.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x61pp/stats/command/command.proto\x12\x16xray.app.stats.command\".\n\x0fGetStatsRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05reset\x18\x02 \x01(\x08\"#\n\x04Stat\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03\">\n\x10GetStatsResponse\x12*\n\x04stat\x18\x01 \x01(\x0b\x32\x1c.xray.app.stats.command.Stat\"3\n\x11QueryStatsRequest\x12\x0f\n\x07pattern\x18\x01 \x01(\t\x12\r\n\x05reset\x18\x02 \x01(\x08\"@\n\x12QueryStatsResponse\x12*\n\x04stat\x18\x01 \x03(\x0b\x32\x1c.xray.app.stats.command.Stat\"\x11\n\x0fSysStatsRequest\"\xc2\x01\n\x10SysStatsResponse\x12\x14\n\x0cNumGoroutine\x18\x01 \x01(\r\x12\r\n\x05NumGC\x18\x02 \x01(\r\x12\r\n\x05\x41lloc\x18\x03 \x01(\x04\x12\x12\n\nTotalAlloc\x18\x04 \x01(\x04\x12\x0b\n\x03Sys\x18\x05 \x01(\x04\x12\x0f\n\x07Mallocs\x18\x06 \x01(\x04\x12\r\n\x05\x46rees\x18\x07 \x01(\x04\x12\x13\n\x0bLiveObjects\x18\x08 \x01(\x04\x12\x14\n\x0cPauseTotalNs\x18\t \x01(\x04\x12\x0e\n\x06Uptime\x18\n \x01(\r\"\x08\n\x06\x43onfig2\xba\x02\n\x0cStatsService\x12_\n\x08GetStats\x12\'.xray.app.stats.command.GetStatsRequest\x1a(.xray.app.stats.command.GetStatsResponse\"\x00\x12\x65\n\nQueryStats\x12).xray.app.stats.command.QueryStatsRequest\x1a*.xray.app.stats.command.QueryStatsResponse\"\x00\x12\x62\n\x0bGetSysStats\x12\'.xray.app.stats.command.SysStatsRequest\x1a(.xray.app.stats.command.SysStatsResponse\"\x00\x42\x64\n\x1a\x63om.xray.app.stats.commandP\x01Z+github.com/xtls/xray-core/app/stats/command\xaa\x02\x16Xray.App.Stats.Commandb\x06proto3')
-
-
-
-_GETSTATSREQUEST = DESCRIPTOR.message_types_by_name['GetStatsRequest']
-_STAT = DESCRIPTOR.message_types_by_name['Stat']
-_GETSTATSRESPONSE = DESCRIPTOR.message_types_by_name['GetStatsResponse']
-_QUERYSTATSREQUEST = DESCRIPTOR.message_types_by_name['QueryStatsRequest']
-_QUERYSTATSRESPONSE = DESCRIPTOR.message_types_by_name['QueryStatsResponse']
-_SYSSTATSREQUEST = DESCRIPTOR.message_types_by_name['SysStatsRequest']
-_SYSSTATSRESPONSE = DESCRIPTOR.message_types_by_name['SysStatsResponse']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-GetStatsRequest = _reflection.GeneratedProtocolMessageType('GetStatsRequest', (_message.Message,), {
- 'DESCRIPTOR' : _GETSTATSREQUEST,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.GetStatsRequest)
- })
-_sym_db.RegisterMessage(GetStatsRequest)
-
-Stat = _reflection.GeneratedProtocolMessageType('Stat', (_message.Message,), {
- 'DESCRIPTOR' : _STAT,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.Stat)
- })
-_sym_db.RegisterMessage(Stat)
-
-GetStatsResponse = _reflection.GeneratedProtocolMessageType('GetStatsResponse', (_message.Message,), {
- 'DESCRIPTOR' : _GETSTATSRESPONSE,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.GetStatsResponse)
- })
-_sym_db.RegisterMessage(GetStatsResponse)
-
-QueryStatsRequest = _reflection.GeneratedProtocolMessageType('QueryStatsRequest', (_message.Message,), {
- 'DESCRIPTOR' : _QUERYSTATSREQUEST,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.QueryStatsRequest)
- })
-_sym_db.RegisterMessage(QueryStatsRequest)
-
-QueryStatsResponse = _reflection.GeneratedProtocolMessageType('QueryStatsResponse', (_message.Message,), {
- 'DESCRIPTOR' : _QUERYSTATSRESPONSE,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.QueryStatsResponse)
- })
-_sym_db.RegisterMessage(QueryStatsResponse)
-
-SysStatsRequest = _reflection.GeneratedProtocolMessageType('SysStatsRequest', (_message.Message,), {
- 'DESCRIPTOR' : _SYSSTATSREQUEST,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.SysStatsRequest)
- })
-_sym_db.RegisterMessage(SysStatsRequest)
-
-SysStatsResponse = _reflection.GeneratedProtocolMessageType('SysStatsResponse', (_message.Message,), {
- 'DESCRIPTOR' : _SYSSTATSRESPONSE,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.SysStatsResponse)
- })
-_sym_db.RegisterMessage(SysStatsResponse)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.stats.command.command_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.command.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-_STATSSERVICE = DESCRIPTOR.services_by_name['StatsService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\032com.xray.app.stats.commandP\001Z+github.com/xtls/xray-core/app/stats/command\252\002\026Xray.App.Stats.Command'
- _GETSTATSREQUEST._serialized_start=59
- _GETSTATSREQUEST._serialized_end=105
- _STAT._serialized_start=107
- _STAT._serialized_end=142
- _GETSTATSRESPONSE._serialized_start=144
- _GETSTATSRESPONSE._serialized_end=206
- _QUERYSTATSREQUEST._serialized_start=208
- _QUERYSTATSREQUEST._serialized_end=259
- _QUERYSTATSRESPONSE._serialized_start=261
- _QUERYSTATSRESPONSE._serialized_end=325
- _SYSSTATSREQUEST._serialized_start=327
- _SYSSTATSREQUEST._serialized_end=344
- _SYSSTATSRESPONSE._serialized_start=347
- _SYSSTATSRESPONSE._serialized_end=541
- _CONFIG._serialized_start=543
- _CONFIG._serialized_end=551
- _STATSSERVICE._serialized_start=554
- _STATSSERVICE._serialized_end=868
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/app/stats/config_grpc.py b/xray_api/proto/app/stats/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: app/stats/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/app/stats/config_pb2.py b/xray_api/proto/app/stats/config_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: app/stats/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x61pp/stats/config.proto\x12\x0exray.app.stats\"\x08\n\x06\x43onfig\"N\n\rChannelConfig\x12\x10\n\x08\x42locking\x18\x01 \x01(\x08\x12\x17\n\x0fSubscriberLimit\x18\x02 \x01(\x05\x12\x12\n\nBufferSize\x18\x03 \x01(\x05\x42L\n\x12\x63om.xray.app.statsP\x01Z#github.com/xtls/xray-core/app/stats\xaa\x02\x0eXray.App.Statsb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CHANNELCONFIG = DESCRIPTOR.message_types_by_name['ChannelConfig']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'app.stats.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-ChannelConfig = _reflection.GeneratedProtocolMessageType('ChannelConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CHANNELCONFIG,
- '__module__' : 'app.stats.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.app.stats.ChannelConfig)
- })
-_sym_db.RegisterMessage(ChannelConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\022com.xray.app.statsP\001Z#github.com/xtls/xray-core/app/stats\252\002\016Xray.App.Stats'
- _CONFIG._serialized_start=42
- _CONFIG._serialized_end=50
- _CHANNELCONFIG._serialized_start=52
- _CHANNELCONFIG._serialized_end=130
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/log/log_grpc.py b/xray_api/proto/common/log/log_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/log/log.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/log/log_pb2.py b/xray_api/proto/common/log/log_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/log/log.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x63ommon/log/log.proto\x12\x0fxray.common.log*D\n\x08Severity\x12\x0b\n\x07Unknown\x10\x00\x12\t\n\x05\x45rror\x10\x01\x12\x0b\n\x07Warning\x10\x02\x12\x08\n\x04Info\x10\x03\x12\t\n\x05\x44\x65\x62ug\x10\x04\x42O\n\x13\x63om.xray.common.logP\x01Z$github.com/xtls/xray-core/common/log\xaa\x02\x0fXray.Common.Logb\x06proto3')
-
-_SEVERITY = DESCRIPTOR.enum_types_by_name['Severity']
-Severity = enum_type_wrapper.EnumTypeWrapper(_SEVERITY)
-Unknown = 0
-Error = 1
-Warning = 2
-Info = 3
-Debug = 4
-
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.common.logP\001Z$github.com/xtls/xray-core/common/log\252\002\017Xray.Common.Log'
- _SEVERITY._serialized_start=41
- _SEVERITY._serialized_end=109
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/net/address_grpc.py b/xray_api/proto/common/net/address_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/net/address.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/net/address_pb2.py b/xray_api/proto/common/net/address_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/net/address.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x63ommon/net/address.proto\x12\x0fxray.common.net\"7\n\nIPOrDomain\x12\x0c\n\x02ip\x18\x01 \x01(\x0cH\x00\x12\x10\n\x06\x64omain\x18\x02 \x01(\tH\x00\x42\t\n\x07\x61\x64\x64ressBO\n\x13\x63om.xray.common.netP\x01Z$github.com/xtls/xray-core/common/net\xaa\x02\x0fXray.Common.Netb\x06proto3')
-
-
-
-_IPORDOMAIN = DESCRIPTOR.message_types_by_name['IPOrDomain']
-IPOrDomain = _reflection.GeneratedProtocolMessageType('IPOrDomain', (_message.Message,), {
- 'DESCRIPTOR' : _IPORDOMAIN,
- '__module__' : 'common.net.address_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.net.IPOrDomain)
- })
-_sym_db.RegisterMessage(IPOrDomain)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.common.netP\001Z$github.com/xtls/xray-core/common/net\252\002\017Xray.Common.Net'
- _IPORDOMAIN._serialized_start=45
- _IPORDOMAIN._serialized_end=100
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/net/destination_grpc.py b/xray_api/proto/common/net/destination_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/net/destination.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/net/destination_pb2.py b/xray_api/proto/common/net/destination_pb2.py
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/net/destination.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import network_pb2 as common_dot_net_dot_network__pb2
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x63ommon/net/destination.proto\x12\x0fxray.common.net\x1a\x18\x63ommon/net/network.proto\x1a\x18\x63ommon/net/address.proto\"q\n\x08\x45ndpoint\x12)\n\x07network\x18\x01 \x01(\x0e\x32\x18.xray.common.net.Network\x12,\n\x07\x61\x64\x64ress\x18\x02 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x0c\n\x04port\x18\x03 \x01(\rBO\n\x13\x63om.xray.common.netP\x01Z$github.com/xtls/xray-core/common/net\xaa\x02\x0fXray.Common.Netb\x06proto3')
-
-
-
-_ENDPOINT = DESCRIPTOR.message_types_by_name['Endpoint']
-Endpoint = _reflection.GeneratedProtocolMessageType('Endpoint', (_message.Message,), {
- 'DESCRIPTOR' : _ENDPOINT,
- '__module__' : 'common.net.destination_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.net.Endpoint)
- })
-_sym_db.RegisterMessage(Endpoint)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.common.netP\001Z$github.com/xtls/xray-core/common/net\252\002\017Xray.Common.Net'
- _ENDPOINT._serialized_start=101
- _ENDPOINT._serialized_end=214
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/net/network_grpc.py b/xray_api/proto/common/net/network_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/net/network.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/net/network_pb2.py b/xray_api/proto/common/net/network_pb2.py
@@ -1,47 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/net/network.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x63ommon/net/network.proto\x12\x0fxray.common.net\"8\n\x0bNetworkList\x12)\n\x07network\x18\x01 \x03(\x0e\x32\x18.xray.common.net.Network*B\n\x07Network\x12\x0b\n\x07Unknown\x10\x00\x12\x0e\n\x06RawTCP\x10\x01\x1a\x02\x08\x01\x12\x07\n\x03TCP\x10\x02\x12\x07\n\x03UDP\x10\x03\x12\x08\n\x04UNIX\x10\x04\x42O\n\x13\x63om.xray.common.netP\x01Z$github.com/xtls/xray-core/common/net\xaa\x02\x0fXray.Common.Netb\x06proto3')
-
-_NETWORK = DESCRIPTOR.enum_types_by_name['Network']
-Network = enum_type_wrapper.EnumTypeWrapper(_NETWORK)
-Unknown = 0
-RawTCP = 1
-TCP = 2
-UDP = 3
-UNIX = 4
-
-
-_NETWORKLIST = DESCRIPTOR.message_types_by_name['NetworkList']
-NetworkList = _reflection.GeneratedProtocolMessageType('NetworkList', (_message.Message,), {
- 'DESCRIPTOR' : _NETWORKLIST,
- '__module__' : 'common.net.network_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.net.NetworkList)
- })
-_sym_db.RegisterMessage(NetworkList)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.common.netP\001Z$github.com/xtls/xray-core/common/net\252\002\017Xray.Common.Net'
- _NETWORK.values_by_name["RawTCP"]._options = None
- _NETWORK.values_by_name["RawTCP"]._serialized_options = b'\010\001'
- _NETWORK._serialized_start=103
- _NETWORK._serialized_end=169
- _NETWORKLIST._serialized_start=45
- _NETWORKLIST._serialized_end=101
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/net/port_grpc.py b/xray_api/proto/common/net/port_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/net/port.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/net/port_pb2.py b/xray_api/proto/common/net/port_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/net/port.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x63ommon/net/port.proto\x12\x0fxray.common.net\"%\n\tPortRange\x12\x0c\n\x04\x46rom\x18\x01 \x01(\r\x12\n\n\x02To\x18\x02 \x01(\r\"5\n\x08PortList\x12)\n\x05range\x18\x01 \x03(\x0b\x32\x1a.xray.common.net.PortRangeBO\n\x13\x63om.xray.common.netP\x01Z$github.com/xtls/xray-core/common/net\xaa\x02\x0fXray.Common.Netb\x06proto3')
-
-
-
-_PORTRANGE = DESCRIPTOR.message_types_by_name['PortRange']
-_PORTLIST = DESCRIPTOR.message_types_by_name['PortList']
-PortRange = _reflection.GeneratedProtocolMessageType('PortRange', (_message.Message,), {
- 'DESCRIPTOR' : _PORTRANGE,
- '__module__' : 'common.net.port_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.net.PortRange)
- })
-_sym_db.RegisterMessage(PortRange)
-
-PortList = _reflection.GeneratedProtocolMessageType('PortList', (_message.Message,), {
- 'DESCRIPTOR' : _PORTLIST,
- '__module__' : 'common.net.port_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.net.PortList)
- })
-_sym_db.RegisterMessage(PortList)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.common.netP\001Z$github.com/xtls/xray-core/common/net\252\002\017Xray.Common.Net'
- _PORTRANGE._serialized_start=42
- _PORTRANGE._serialized_end=79
- _PORTLIST._serialized_start=81
- _PORTLIST._serialized_end=134
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/protocol/headers_grpc.py b/xray_api/proto/common/protocol/headers_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/protocol/headers.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/protocol/headers_pb2.py b/xray_api/proto/common/protocol/headers_pb2.py
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/protocol/headers.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x63ommon/protocol/headers.proto\x12\x14xray.common.protocol\"B\n\x0eSecurityConfig\x12\x30\n\x04type\x18\x01 \x01(\x0e\x32\".xray.common.protocol.SecurityType*`\n\x0cSecurityType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04\x41UTO\x10\x02\x12\x0e\n\nAES128_GCM\x10\x03\x12\x15\n\x11\x43HACHA20_POLY1305\x10\x04\x12\x08\n\x04NONE\x10\x05\x12\x08\n\x04ZERO\x10\x06\x42^\n\x18\x63om.xray.common.protocolP\x01Z)github.com/xtls/xray-core/common/protocol\xaa\x02\x14Xray.Common.Protocolb\x06proto3')
-
-_SECURITYTYPE = DESCRIPTOR.enum_types_by_name['SecurityType']
-SecurityType = enum_type_wrapper.EnumTypeWrapper(_SECURITYTYPE)
-UNKNOWN = 0
-AUTO = 2
-AES128_GCM = 3
-CHACHA20_POLY1305 = 4
-NONE = 5
-ZERO = 6
-
-
-_SECURITYCONFIG = DESCRIPTOR.message_types_by_name['SecurityConfig']
-SecurityConfig = _reflection.GeneratedProtocolMessageType('SecurityConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SECURITYCONFIG,
- '__module__' : 'common.protocol.headers_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.protocol.SecurityConfig)
- })
-_sym_db.RegisterMessage(SecurityConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.common.protocolP\001Z)github.com/xtls/xray-core/common/protocol\252\002\024Xray.Common.Protocol'
- _SECURITYTYPE._serialized_start=123
- _SECURITYTYPE._serialized_end=219
- _SECURITYCONFIG._serialized_start=55
- _SECURITYCONFIG._serialized_end=121
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/protocol/server_spec_grpc.py b/xray_api/proto/common/protocol/server_spec_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/protocol/server_spec.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/protocol/server_spec_pb2.py b/xray_api/proto/common/protocol/server_spec_pb2.py
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/protocol/server_spec.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-from xray_api.proto.common.protocol import user_pb2 as common_dot_protocol_dot_user__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!common/protocol/server_spec.proto\x12\x14xray.common.protocol\x1a\x18\x63ommon/net/address.proto\x1a\x1a\x63ommon/protocol/user.proto\"v\n\x0eServerEndpoint\x12,\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x0c\n\x04port\x18\x02 \x01(\r\x12(\n\x04user\x18\x03 \x03(\x0b\x32\x1a.xray.common.protocol.UserB^\n\x18\x63om.xray.common.protocolP\x01Z)github.com/xtls/xray-core/common/protocol\xaa\x02\x14Xray.Common.Protocolb\x06proto3')
-
-
-
-_SERVERENDPOINT = DESCRIPTOR.message_types_by_name['ServerEndpoint']
-ServerEndpoint = _reflection.GeneratedProtocolMessageType('ServerEndpoint', (_message.Message,), {
- 'DESCRIPTOR' : _SERVERENDPOINT,
- '__module__' : 'common.protocol.server_spec_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.protocol.ServerEndpoint)
- })
-_sym_db.RegisterMessage(ServerEndpoint)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.common.protocolP\001Z)github.com/xtls/xray-core/common/protocol\252\002\024Xray.Common.Protocol'
- _SERVERENDPOINT._serialized_start=113
- _SERVERENDPOINT._serialized_end=231
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/protocol/user_grpc.py b/xray_api/proto/common/protocol/user_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/protocol/user.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/protocol/user_pb2.py b/xray_api/proto/common/protocol/user_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/protocol/user.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x63ommon/protocol/user.proto\x12\x14xray.common.protocol\x1a!common/serial/typed_message.proto\"W\n\x04User\x12\r\n\x05level\x18\x01 \x01(\r\x12\r\n\x05\x65mail\x18\x02 \x01(\t\x12\x31\n\x07\x61\x63\x63ount\x18\x03 \x01(\x0b\x32 .xray.common.serial.TypedMessageB^\n\x18\x63om.xray.common.protocolP\x01Z)github.com/xtls/xray-core/common/protocol\xaa\x02\x14Xray.Common.Protocolb\x06proto3')
-
-
-
-_USER = DESCRIPTOR.message_types_by_name['User']
-User = _reflection.GeneratedProtocolMessageType('User', (_message.Message,), {
- 'DESCRIPTOR' : _USER,
- '__module__' : 'common.protocol.user_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.protocol.User)
- })
-_sym_db.RegisterMessage(User)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.common.protocolP\001Z)github.com/xtls/xray-core/common/protocol\252\002\024Xray.Common.Protocol'
- _USER._serialized_start=87
- _USER._serialized_end=174
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/common/serial/typed_message_grpc.py b/xray_api/proto/common/serial/typed_message_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: common/serial/typed_message.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/common/serial/typed_message_pb2.py b/xray_api/proto/common/serial/typed_message_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: common/serial/typed_message.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!common/serial/typed_message.proto\x12\x12xray.common.serial\"+\n\x0cTypedMessage\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\x42X\n\x16\x63om.xray.common.serialP\x01Z\'github.com/xtls/xray-core/common/serial\xaa\x02\x12Xray.Common.Serialb\x06proto3')
-
-
-
-_TYPEDMESSAGE = DESCRIPTOR.message_types_by_name['TypedMessage']
-TypedMessage = _reflection.GeneratedProtocolMessageType('TypedMessage', (_message.Message,), {
- 'DESCRIPTOR' : _TYPEDMESSAGE,
- '__module__' : 'common.serial.typed_message_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.common.serial.TypedMessage)
- })
-_sym_db.RegisterMessage(TypedMessage)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\026com.xray.common.serialP\001Z\'github.com/xtls/xray-core/common/serial\252\002\022Xray.Common.Serial'
- _TYPEDMESSAGE._serialized_start=57
- _TYPEDMESSAGE._serialized_end=100
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/compile.py b/xray_api/proto/compile.py
@@ -1,98 +0,0 @@
-# DO NOT RUN THIS SCRIPT
-# This supposed to be used for development
-
-
-import io
-import os
-import re
-import sys
-import tarfile
-import tempfile
-from pathlib import Path
-
-import requests
-from genericpath import isdir
-
-# Compile proto files from github repository
-
-
-def compile_proto_from_source(dist):
- tmp = tempfile.TemporaryDirectory()
- tmp_dir = tmp.name
-
- # download and extract source
- print("Getting latest version...")
- latest = requests.get('https://api.github.com/repos/XTLS/xray-core/releases/latest') \
- .json() \
- .get('tag_name')
- print("Latest version is", latest)
-
- # version = 'v4.45.2'
- version = latest
-
- print("Downloading source", version, "...")
- download_url = f'https://github.com/XTLS/xray-core/archive/refs/tags/{version}.tar.gz'
- print("Source downloaded. extracting and compiling...")
- r = requests.get(download_url, stream=True)
- io_bytes = io.BytesIO(r.content)
- tar = tarfile.open(fileobj=io_bytes, mode='r')
- tar.extractall(tmp_dir)
- v2ray_dir = os.path.join(tmp_dir, tar.getnames()[0])
- tar.close()
- io_bytes.close()
-
- # find proto files
- proto_files = ''
- for root, dirs, files in os.walk(tmp_dir):
- for file in files:
- if file.endswith(".proto"):
- proto_files += ' ' + os.path.join(root, file)
-
- if not proto_files:
- raise FileNotFoundError("there's no proto file.")
-
- command = f'{sys.executable} -m grpc.tools.protoc ' \
- f'-I={v2ray_dir} ' \
- f'--python_out={dist} ' \
- f'--grpclib_python_out={dist} ' + proto_files
-
- os.system(command)
-
- tmp.cleanup()
- print("Compile ended.")
-
-
-def fix_proto_imports(dist):
- curr_dir = Path(__file__).resolve().parent
- parent_dir = curr_dir.parent
-
- imports = []
- for f in os.listdir('.'):
- if os.path.isdir(f) and not f.startswith('__'):
- imports.append(f)
-
- new_imp = f'{parent_dir.name}.{curr_dir.name}.' + '{}'
-
- for root, dirs, files in os.walk('.'):
- for file in files:
- if file == 'compile.py':
- continue
-
- if file.endswith(".py"):
- path = Path(root) / file
- with open(path, 'r') as pyfile:
- content = pyfile.read()
- for imp in imports:
- content = re.sub(fr"^([^'\r\n]*){imp}([\s\.].*)$", fr"\1{parent_dir.name}.{curr_dir.name}.{imp}\2", content, flags=re.MULTILINE)
- content = re.sub(fr"^(.*importlib\.import_module\(\'){imp}(.*)$", fr"\1{parent_dir.name}.{curr_dir.name}.{imp}\2", content, flags=re.MULTILINE)
-
- with open(path, 'w') as pyfile:
- pyfile.write(content)
-
-
-if __name__ == "__main__":
- print("Compiling source...")
- compile_proto_from_source('.')
- print("Fixing imports...")
- fix_proto_imports('.')
- print("Done.")
diff --git a/xray_api/proto/core/config_grpc.py b/xray_api/proto/core/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: core/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/core/config_pb2.py b/xray_api/proto/core/config_pb2.py
@@ -1,60 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: core/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-import importlib
-transport_dot_global_dot_config__pb2 = importlib.import_module('xray_api.proto.transport.global.config_pb2')
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x63ore/config.proto\x12\txray.core\x1a!common/serial/typed_message.proto\x1a\x1dtransport/global/config.proto\"\x87\x02\n\x06\x43onfig\x12\x30\n\x07inbound\x18\x01 \x03(\x0b\x32\x1f.xray.core.InboundHandlerConfig\x12\x32\n\x08outbound\x18\x02 \x03(\x0b\x32 .xray.core.OutboundHandlerConfig\x12-\n\x03\x61pp\x18\x04 \x03(\x0b\x32 .xray.common.serial.TypedMessage\x12-\n\ttransport\x18\x05 \x01(\x0b\x32\x16.xray.transport.ConfigB\x02\x18\x01\x12\x33\n\textension\x18\x06 \x03(\x0b\x32 .xray.common.serial.TypedMessageJ\x04\x08\x03\x10\x04\"\x9a\x01\n\x14InboundHandlerConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12;\n\x11receiver_settings\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x38\n\x0eproxy_settings\x18\x03 \x01(\x0b\x32 .xray.common.serial.TypedMessage\"\xba\x01\n\x15OutboundHandlerConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x39\n\x0fsender_settings\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x38\n\x0eproxy_settings\x18\x03 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x0e\n\x06\x65xpire\x18\x04 \x01(\x03\x12\x0f\n\x07\x63omment\x18\x05 \x01(\tB=\n\rcom.xray.coreP\x01Z\x1egithub.com/xtls/xray-core/core\xaa\x02\tXray.Coreb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_INBOUNDHANDLERCONFIG = DESCRIPTOR.message_types_by_name['InboundHandlerConfig']
-_OUTBOUNDHANDLERCONFIG = DESCRIPTOR.message_types_by_name['OutboundHandlerConfig']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'core.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-InboundHandlerConfig = _reflection.GeneratedProtocolMessageType('InboundHandlerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _INBOUNDHANDLERCONFIG,
- '__module__' : 'core.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.InboundHandlerConfig)
- })
-_sym_db.RegisterMessage(InboundHandlerConfig)
-
-OutboundHandlerConfig = _reflection.GeneratedProtocolMessageType('OutboundHandlerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _OUTBOUNDHANDLERCONFIG,
- '__module__' : 'core.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.core.OutboundHandlerConfig)
- })
-_sym_db.RegisterMessage(OutboundHandlerConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\rcom.xray.coreP\001Z\036github.com/xtls/xray-core/core\252\002\tXray.Core'
- _CONFIG.fields_by_name['transport']._options = None
- _CONFIG.fields_by_name['transport']._serialized_options = b'\030\001'
- _CONFIG._serialized_start=99
- _CONFIG._serialized_end=362
- _INBOUNDHANDLERCONFIG._serialized_start=365
- _INBOUNDHANDLERCONFIG._serialized_end=519
- _OUTBOUNDHANDLERCONFIG._serialized_start=522
- _OUTBOUNDHANDLERCONFIG._serialized_end=708
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/blackhole/config_grpc.py b/xray_api/proto/proxy/blackhole/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/blackhole/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/blackhole/config_pb2.py b/xray_api/proto/proxy/blackhole/config_pb2.py
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/blackhole/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cproxy/blackhole/config.proto\x12\x14xray.proxy.blackhole\x1a!common/serial/typed_message.proto\"\x0e\n\x0cNoneResponse\"\x0e\n\x0cHTTPResponse\"<\n\x06\x43onfig\x12\x32\n\x08response\x18\x01 \x01(\x0b\x32 .xray.common.serial.TypedMessageB^\n\x18\x63om.xray.proxy.blackholeP\x01Z)github.com/xtls/xray-core/proxy/blackhole\xaa\x02\x14Xray.Proxy.Blackholeb\x06proto3')
-
-
-
-_NONERESPONSE = DESCRIPTOR.message_types_by_name['NoneResponse']
-_HTTPRESPONSE = DESCRIPTOR.message_types_by_name['HTTPResponse']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-NoneResponse = _reflection.GeneratedProtocolMessageType('NoneResponse', (_message.Message,), {
- 'DESCRIPTOR' : _NONERESPONSE,
- '__module__' : 'proxy.blackhole.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.blackhole.NoneResponse)
- })
-_sym_db.RegisterMessage(NoneResponse)
-
-HTTPResponse = _reflection.GeneratedProtocolMessageType('HTTPResponse', (_message.Message,), {
- 'DESCRIPTOR' : _HTTPRESPONSE,
- '__module__' : 'proxy.blackhole.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.blackhole.HTTPResponse)
- })
-_sym_db.RegisterMessage(HTTPResponse)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.blackhole.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.blackhole.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.proxy.blackholeP\001Z)github.com/xtls/xray-core/proxy/blackhole\252\002\024Xray.Proxy.Blackhole'
- _NONERESPONSE._serialized_start=89
- _NONERESPONSE._serialized_end=103
- _HTTPRESPONSE._serialized_start=105
- _HTTPRESPONSE._serialized_end=119
- _CONFIG._serialized_start=121
- _CONFIG._serialized_end=181
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/dns/config_grpc.py b/xray_api/proto/proxy/dns/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/dns/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/dns/config_pb2.py b/xray_api/proto/proxy/dns/config_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/dns/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import destination_pb2 as common_dot_net_dot_destination__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16proxy/dns/config.proto\x12\x0exray.proxy.dns\x1a\x1c\x63ommon/net/destination.proto\"]\n\x06\x43onfig\x12)\n\x06server\x18\x01 \x01(\x0b\x32\x19.xray.common.net.Endpoint\x12\x12\n\nuser_level\x18\x02 \x01(\r\x12\x14\n\x0cnon_IP_query\x18\x03 \x01(\tBL\n\x12\x63om.xray.proxy.dnsP\x01Z#github.com/xtls/xray-core/proxy/dns\xaa\x02\x0eXray.Proxy.Dnsb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.dns.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\022com.xray.proxy.dnsP\001Z#github.com/xtls/xray-core/proxy/dns\252\002\016Xray.Proxy.Dns'
- _CONFIG._serialized_start=72
- _CONFIG._serialized_end=165
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/dokodemo/config_grpc.py b/xray_api/proto/proxy/dokodemo/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/dokodemo/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/dokodemo/config_pb2.py b/xray_api/proto/proxy/dokodemo/config_pb2.py
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/dokodemo/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-from xray_api.proto.common.net import network_pb2 as common_dot_net_dot_network__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bproxy/dokodemo/config.proto\x12\x13xray.proxy.dokodemo\x1a\x18\x63ommon/net/address.proto\x1a\x18\x63ommon/net/network.proto\"\xea\x01\n\x06\x43onfig\x12,\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x36\n\x0cnetwork_list\x18\x03 \x01(\x0b\x32\x1c.xray.common.net.NetworkListB\x02\x18\x01\x12*\n\x08networks\x18\x07 \x03(\x0e\x32\x18.xray.common.net.Network\x12\x13\n\x07timeout\x18\x04 \x01(\rB\x02\x18\x01\x12\x17\n\x0f\x66ollow_redirect\x18\x05 \x01(\x08\x12\x12\n\nuser_level\x18\x06 \x01(\rB[\n\x17\x63om.xray.proxy.dokodemoP\x01Z(github.com/xtls/xray-core/proxy/dokodemo\xaa\x02\x13Xray.Proxy.Dokodemob\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.dokodemo.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.dokodemo.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\027com.xray.proxy.dokodemoP\001Z(github.com/xtls/xray-core/proxy/dokodemo\252\002\023Xray.Proxy.Dokodemo'
- _CONFIG.fields_by_name['network_list']._options = None
- _CONFIG.fields_by_name['network_list']._serialized_options = b'\030\001'
- _CONFIG.fields_by_name['timeout']._options = None
- _CONFIG.fields_by_name['timeout']._serialized_options = b'\030\001'
- _CONFIG._serialized_start=105
- _CONFIG._serialized_end=339
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/freedom/config_grpc.py b/xray_api/proto/proxy/freedom/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/freedom/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/freedom/config_pb2.py b/xray_api/proto/proxy/freedom/config_pb2.py
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/freedom/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aproxy/freedom/config.proto\x12\x12xray.proxy.freedom\x1a!common/protocol/server_spec.proto\"K\n\x13\x44\x65stinationOverride\x12\x34\n\x06server\x18\x01 \x01(\x0b\x32$.xray.common.protocol.ServerEndpoint\"\x88\x01\n\x08\x46ragment\x12\x14\n\x0cpackets_from\x18\x01 \x01(\x04\x12\x12\n\npackets_to\x18\x02 \x01(\x04\x12\x12\n\nlength_min\x18\x03 \x01(\x04\x12\x12\n\nlength_max\x18\x04 \x01(\x04\x12\x14\n\x0cinterval_min\x18\x05 \x01(\x04\x12\x14\n\x0cinterval_max\x18\x06 \x01(\x04\"\x98\x03\n\x06\x43onfig\x12\x42\n\x0f\x64omain_strategy\x18\x01 \x01(\x0e\x32).xray.proxy.freedom.Config.DomainStrategy\x12\x13\n\x07timeout\x18\x02 \x01(\rB\x02\x18\x01\x12\x45\n\x14\x64\x65stination_override\x18\x03 \x01(\x0b\x32\'.xray.proxy.freedom.DestinationOverride\x12\x12\n\nuser_level\x18\x04 \x01(\r\x12.\n\x08\x66ragment\x18\x05 \x01(\x0b\x32\x1c.xray.proxy.freedom.Fragment\"\xa9\x01\n\x0e\x44omainStrategy\x12\t\n\x05\x41S_IS\x10\x00\x12\n\n\x06USE_IP\x10\x01\x12\x0b\n\x07USE_IP4\x10\x02\x12\x0b\n\x07USE_IP6\x10\x03\x12\x0c\n\x08USE_IP46\x10\x04\x12\x0c\n\x08USE_IP64\x10\x05\x12\x0c\n\x08\x46ORCE_IP\x10\x06\x12\r\n\tFORCE_IP4\x10\x07\x12\r\n\tFORCE_IP6\x10\x08\x12\x0e\n\nFORCE_IP46\x10\t\x12\x0e\n\nFORCE_IP64\x10\nBX\n\x16\x63om.xray.proxy.freedomP\x01Z\'github.com/xtls/xray-core/proxy/freedom\xaa\x02\x12Xray.Proxy.Freedomb\x06proto3')
-
-
-
-_DESTINATIONOVERRIDE = DESCRIPTOR.message_types_by_name['DestinationOverride']
-_FRAGMENT = DESCRIPTOR.message_types_by_name['Fragment']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CONFIG_DOMAINSTRATEGY = _CONFIG.enum_types_by_name['DomainStrategy']
-DestinationOverride = _reflection.GeneratedProtocolMessageType('DestinationOverride', (_message.Message,), {
- 'DESCRIPTOR' : _DESTINATIONOVERRIDE,
- '__module__' : 'proxy.freedom.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.freedom.DestinationOverride)
- })
-_sym_db.RegisterMessage(DestinationOverride)
-
-Fragment = _reflection.GeneratedProtocolMessageType('Fragment', (_message.Message,), {
- 'DESCRIPTOR' : _FRAGMENT,
- '__module__' : 'proxy.freedom.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.freedom.Fragment)
- })
-_sym_db.RegisterMessage(Fragment)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.freedom.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.freedom.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\026com.xray.proxy.freedomP\001Z\'github.com/xtls/xray-core/proxy/freedom\252\002\022Xray.Proxy.Freedom'
- _CONFIG.fields_by_name['timeout']._options = None
- _CONFIG.fields_by_name['timeout']._serialized_options = b'\030\001'
- _DESTINATIONOVERRIDE._serialized_start=85
- _DESTINATIONOVERRIDE._serialized_end=160
- _FRAGMENT._serialized_start=163
- _FRAGMENT._serialized_end=299
- _CONFIG._serialized_start=302
- _CONFIG._serialized_end=710
- _CONFIG_DOMAINSTRATEGY._serialized_start=541
- _CONFIG_DOMAINSTRATEGY._serialized_end=710
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/http/config_grpc.py b/xray_api/proto/proxy/http/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/http/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/http/config_pb2.py b/xray_api/proto/proxy/http/config_pb2.py
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/http/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17proxy/http/config.proto\x12\x0fxray.proxy.http\x1a!common/protocol/server_spec.proto\"-\n\x07\x41\x63\x63ount\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xc2\x01\n\x0cServerConfig\x12\x13\n\x07timeout\x18\x01 \x01(\rB\x02\x18\x01\x12=\n\x08\x61\x63\x63ounts\x18\x02 \x03(\x0b\x32+.xray.proxy.http.ServerConfig.AccountsEntry\x12\x19\n\x11\x61llow_transparent\x18\x03 \x01(\x08\x12\x12\n\nuser_level\x18\x04 \x01(\r\x1a/\n\rAccountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"$\n\x06Header\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"m\n\x0c\x43lientConfig\x12\x34\n\x06server\x18\x01 \x03(\x0b\x32$.xray.common.protocol.ServerEndpoint\x12\'\n\x06header\x18\x02 \x03(\x0b\x32\x17.xray.proxy.http.HeaderBO\n\x13\x63om.xray.proxy.httpP\x01Z$github.com/xtls/xray-core/proxy/http\xaa\x02\x0fXray.Proxy.Httpb\x06proto3')
-
-
-
-_ACCOUNT = DESCRIPTOR.message_types_by_name['Account']
-_SERVERCONFIG = DESCRIPTOR.message_types_by_name['ServerConfig']
-_SERVERCONFIG_ACCOUNTSENTRY = _SERVERCONFIG.nested_types_by_name['AccountsEntry']
-_HEADER = DESCRIPTOR.message_types_by_name['Header']
-_CLIENTCONFIG = DESCRIPTOR.message_types_by_name['ClientConfig']
-Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), {
- 'DESCRIPTOR' : _ACCOUNT,
- '__module__' : 'proxy.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.http.Account)
- })
-_sym_db.RegisterMessage(Account)
-
-ServerConfig = _reflection.GeneratedProtocolMessageType('ServerConfig', (_message.Message,), {
-
- 'AccountsEntry' : _reflection.GeneratedProtocolMessageType('AccountsEntry', (_message.Message,), {
- 'DESCRIPTOR' : _SERVERCONFIG_ACCOUNTSENTRY,
- '__module__' : 'proxy.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.http.ServerConfig.AccountsEntry)
- })
- ,
- 'DESCRIPTOR' : _SERVERCONFIG,
- '__module__' : 'proxy.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.http.ServerConfig)
- })
-_sym_db.RegisterMessage(ServerConfig)
-_sym_db.RegisterMessage(ServerConfig.AccountsEntry)
-
-Header = _reflection.GeneratedProtocolMessageType('Header', (_message.Message,), {
- 'DESCRIPTOR' : _HEADER,
- '__module__' : 'proxy.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.http.Header)
- })
-_sym_db.RegisterMessage(Header)
-
-ClientConfig = _reflection.GeneratedProtocolMessageType('ClientConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CLIENTCONFIG,
- '__module__' : 'proxy.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.http.ClientConfig)
- })
-_sym_db.RegisterMessage(ClientConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\023com.xray.proxy.httpP\001Z$github.com/xtls/xray-core/proxy/http\252\002\017Xray.Proxy.Http'
- _SERVERCONFIG_ACCOUNTSENTRY._options = None
- _SERVERCONFIG_ACCOUNTSENTRY._serialized_options = b'8\001'
- _SERVERCONFIG.fields_by_name['timeout']._options = None
- _SERVERCONFIG.fields_by_name['timeout']._serialized_options = b'\030\001'
- _ACCOUNT._serialized_start=79
- _ACCOUNT._serialized_end=124
- _SERVERCONFIG._serialized_start=127
- _SERVERCONFIG._serialized_end=321
- _SERVERCONFIG_ACCOUNTSENTRY._serialized_start=274
- _SERVERCONFIG_ACCOUNTSENTRY._serialized_end=321
- _HEADER._serialized_start=323
- _HEADER._serialized_end=359
- _CLIENTCONFIG._serialized_start=361
- _CLIENTCONFIG._serialized_end=470
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/loopback/config_grpc.py b/xray_api/proto/proxy/loopback/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/loopback/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/loopback/config_pb2.py b/xray_api/proto/proxy/loopback/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/loopback/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bproxy/loopback/config.proto\x12\x13xray.proxy.loopback\"\x1d\n\x06\x43onfig\x12\x13\n\x0binbound_tag\x18\x01 \x01(\tB[\n\x17\x63om.xray.proxy.loopbackP\x01Z(github.com/xtls/xray-core/proxy/loopback\xaa\x02\x13Xray.Proxy.Loopbackb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.loopback.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.loopback.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\027com.xray.proxy.loopbackP\001Z(github.com/xtls/xray-core/proxy/loopback\252\002\023Xray.Proxy.Loopback'
- _CONFIG._serialized_start=52
- _CONFIG._serialized_end=81
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/shadowsocks/config_grpc.py b/xray_api/proto/proxy/shadowsocks/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/shadowsocks/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/shadowsocks/config_pb2.py b/xray_api/proto/proxy/shadowsocks/config_pb2.py
@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/shadowsocks/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import network_pb2 as common_dot_net_dot_network__pb2
-from xray_api.proto.common.protocol import user_pb2 as common_dot_protocol_dot_user__pb2
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1eproxy/shadowsocks/config.proto\x12\x16xray.proxy.shadowsocks\x1a\x18\x63ommon/net/network.proto\x1a\x1a\x63ommon/protocol/user.proto\x1a!common/protocol/server_spec.proto\"f\n\x07\x41\x63\x63ount\x12\x10\n\x08password\x18\x01 \x01(\t\x12\x37\n\x0b\x63ipher_type\x18\x02 \x01(\x0e\x32\".xray.proxy.shadowsocks.CipherType\x12\x10\n\x08iv_check\x18\x03 \x01(\x08\"d\n\x0cServerConfig\x12)\n\x05users\x18\x01 \x03(\x0b\x32\x1a.xray.common.protocol.User\x12)\n\x07network\x18\x02 \x03(\x0e\x32\x18.xray.common.net.Network\"D\n\x0c\x43lientConfig\x12\x34\n\x06server\x18\x01 \x03(\x0b\x32$.xray.common.protocol.ServerEndpoint*t\n\nCipherType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0f\n\x0b\x41\x45S_128_GCM\x10\x05\x12\x0f\n\x0b\x41\x45S_256_GCM\x10\x06\x12\x15\n\x11\x43HACHA20_POLY1305\x10\x07\x12\x16\n\x12XCHACHA20_POLY1305\x10\x08\x12\x08\n\x04NONE\x10\tBd\n\x1a\x63om.xray.proxy.shadowsocksP\x01Z+github.com/xtls/xray-core/proxy/shadowsocks\xaa\x02\x16Xray.Proxy.Shadowsocksb\x06proto3')
-
-_CIPHERTYPE = DESCRIPTOR.enum_types_by_name['CipherType']
-CipherType = enum_type_wrapper.EnumTypeWrapper(_CIPHERTYPE)
-UNKNOWN = 0
-AES_128_GCM = 5
-AES_256_GCM = 6
-CHACHA20_POLY1305 = 7
-XCHACHA20_POLY1305 = 8
-NONE = 9
-
-
-_ACCOUNT = DESCRIPTOR.message_types_by_name['Account']
-_SERVERCONFIG = DESCRIPTOR.message_types_by_name['ServerConfig']
-_CLIENTCONFIG = DESCRIPTOR.message_types_by_name['ClientConfig']
-Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), {
- 'DESCRIPTOR' : _ACCOUNT,
- '__module__' : 'proxy.shadowsocks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks.Account)
- })
-_sym_db.RegisterMessage(Account)
-
-ServerConfig = _reflection.GeneratedProtocolMessageType('ServerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SERVERCONFIG,
- '__module__' : 'proxy.shadowsocks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks.ServerConfig)
- })
-_sym_db.RegisterMessage(ServerConfig)
-
-ClientConfig = _reflection.GeneratedProtocolMessageType('ClientConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CLIENTCONFIG,
- '__module__' : 'proxy.shadowsocks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks.ClientConfig)
- })
-_sym_db.RegisterMessage(ClientConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\032com.xray.proxy.shadowsocksP\001Z+github.com/xtls/xray-core/proxy/shadowsocks\252\002\026Xray.Proxy.Shadowsocks'
- _CIPHERTYPE._serialized_start=423
- _CIPHERTYPE._serialized_end=539
- _ACCOUNT._serialized_start=147
- _ACCOUNT._serialized_end=249
- _SERVERCONFIG._serialized_start=251
- _SERVERCONFIG._serialized_end=351
- _CLIENTCONFIG._serialized_start=353
- _CLIENTCONFIG._serialized_end=421
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/shadowsocks_2022/config_grpc.py b/xray_api/proto/proxy/shadowsocks_2022/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/shadowsocks_2022/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/shadowsocks_2022/config_pb2.py b/xray_api/proto/proxy/shadowsocks_2022/config_pb2.py
@@ -1,87 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/shadowsocks_2022/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import network_pb2 as common_dot_net_dot_network__pb2
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#proxy/shadowsocks_2022/config.proto\x12\x1bxray.proxy.shadowsocks_2022\x1a\x18\x63ommon/net/network.proto\x1a\x18\x63ommon/net/address.proto\"t\n\x0cServerConfig\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\r\n\x05\x65mail\x18\x03 \x01(\t\x12\r\n\x05level\x18\x04 \x01(\x05\x12)\n\x07network\x18\x05 \x03(\x0e\x32\x18.xray.common.net.Network\"\x91\x01\n\x15MultiUserServerConfig\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x30\n\x05users\x18\x03 \x03(\x0b\x32!.xray.proxy.shadowsocks_2022.User\x12)\n\x07network\x18\x04 \x03(\x0e\x32\x18.xray.common.net.Network\"y\n\x10RelayDestination\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x07\x61\x64\x64ress\x18\x02 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x0c\n\x04port\x18\x03 \x01(\r\x12\r\n\x05\x65mail\x18\x04 \x01(\t\x12\r\n\x05level\x18\x05 \x01(\x05\"\xa0\x01\n\x11RelayServerConfig\x12\x0e\n\x06method\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x43\n\x0c\x64\x65stinations\x18\x03 \x03(\x0b\x32-.xray.proxy.shadowsocks_2022.RelayDestination\x12)\n\x07network\x18\x04 \x03(\x0e\x32\x18.xray.common.net.Network\"1\n\x04User\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05\x65mail\x18\x02 \x01(\t\x12\r\n\x05level\x18\x03 \x01(\x05\"\x9b\x01\n\x0c\x43lientConfig\x12,\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x0e\n\x06method\x18\x03 \x01(\t\x12\x0b\n\x03key\x18\x04 \x01(\t\x12\x14\n\x0cudp_over_tcp\x18\x05 \x01(\x08\x12\x1c\n\x14udp_over_tcp_version\x18\x06 \x01(\rBr\n\x1f\x63om.xray.proxy.shadowsocks_2022P\x01Z0github.com/xtls/xray-core/proxy/shadowsocks_2022\xaa\x02\x1aXray.Proxy.Shadowsocks2022b\x06proto3')
-
-
-
-_SERVERCONFIG = DESCRIPTOR.message_types_by_name['ServerConfig']
-_MULTIUSERSERVERCONFIG = DESCRIPTOR.message_types_by_name['MultiUserServerConfig']
-_RELAYDESTINATION = DESCRIPTOR.message_types_by_name['RelayDestination']
-_RELAYSERVERCONFIG = DESCRIPTOR.message_types_by_name['RelayServerConfig']
-_USER = DESCRIPTOR.message_types_by_name['User']
-_CLIENTCONFIG = DESCRIPTOR.message_types_by_name['ClientConfig']
-ServerConfig = _reflection.GeneratedProtocolMessageType('ServerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SERVERCONFIG,
- '__module__' : 'proxy.shadowsocks_2022.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks_2022.ServerConfig)
- })
-_sym_db.RegisterMessage(ServerConfig)
-
-MultiUserServerConfig = _reflection.GeneratedProtocolMessageType('MultiUserServerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _MULTIUSERSERVERCONFIG,
- '__module__' : 'proxy.shadowsocks_2022.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks_2022.MultiUserServerConfig)
- })
-_sym_db.RegisterMessage(MultiUserServerConfig)
-
-RelayDestination = _reflection.GeneratedProtocolMessageType('RelayDestination', (_message.Message,), {
- 'DESCRIPTOR' : _RELAYDESTINATION,
- '__module__' : 'proxy.shadowsocks_2022.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks_2022.RelayDestination)
- })
-_sym_db.RegisterMessage(RelayDestination)
-
-RelayServerConfig = _reflection.GeneratedProtocolMessageType('RelayServerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _RELAYSERVERCONFIG,
- '__module__' : 'proxy.shadowsocks_2022.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks_2022.RelayServerConfig)
- })
-_sym_db.RegisterMessage(RelayServerConfig)
-
-User = _reflection.GeneratedProtocolMessageType('User', (_message.Message,), {
- 'DESCRIPTOR' : _USER,
- '__module__' : 'proxy.shadowsocks_2022.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks_2022.User)
- })
-_sym_db.RegisterMessage(User)
-
-ClientConfig = _reflection.GeneratedProtocolMessageType('ClientConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CLIENTCONFIG,
- '__module__' : 'proxy.shadowsocks_2022.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.shadowsocks_2022.ClientConfig)
- })
-_sym_db.RegisterMessage(ClientConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\037com.xray.proxy.shadowsocks_2022P\001Z0github.com/xtls/xray-core/proxy/shadowsocks_2022\252\002\032Xray.Proxy.Shadowsocks2022'
- _SERVERCONFIG._serialized_start=120
- _SERVERCONFIG._serialized_end=236
- _MULTIUSERSERVERCONFIG._serialized_start=239
- _MULTIUSERSERVERCONFIG._serialized_end=384
- _RELAYDESTINATION._serialized_start=386
- _RELAYDESTINATION._serialized_end=507
- _RELAYSERVERCONFIG._serialized_start=510
- _RELAYSERVERCONFIG._serialized_end=670
- _USER._serialized_start=672
- _USER._serialized_end=721
- _CLIENTCONFIG._serialized_start=724
- _CLIENTCONFIG._serialized_end=879
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/socks/config_grpc.py b/xray_api/proto/proxy/socks/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/socks/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/socks/config_pb2.py b/xray_api/proto/proxy/socks/config_pb2.py
@@ -1,86 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/socks/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.net import address_pb2 as common_dot_net_dot_address__pb2
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18proxy/socks/config.proto\x12\x10xray.proxy.socks\x1a\x18\x63ommon/net/address.proto\x1a!common/protocol/server_spec.proto\"-\n\x07\x41\x63\x63ount\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\x9a\x02\n\x0cServerConfig\x12-\n\tauth_type\x18\x01 \x01(\x0e\x32\x1a.xray.proxy.socks.AuthType\x12>\n\x08\x61\x63\x63ounts\x18\x02 \x03(\x0b\x32,.xray.proxy.socks.ServerConfig.AccountsEntry\x12,\n\x07\x61\x64\x64ress\x18\x03 \x01(\x0b\x32\x1b.xray.common.net.IPOrDomain\x12\x13\n\x0budp_enabled\x18\x04 \x01(\x08\x12\x13\n\x07timeout\x18\x05 \x01(\rB\x02\x18\x01\x12\x12\n\nuser_level\x18\x06 \x01(\r\x1a/\n\rAccountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"p\n\x0c\x43lientConfig\x12\x34\n\x06server\x18\x01 \x03(\x0b\x32$.xray.common.protocol.ServerEndpoint\x12*\n\x07version\x18\x02 \x01(\x0e\x32\x19.xray.proxy.socks.Version*%\n\x08\x41uthType\x12\x0b\n\x07NO_AUTH\x10\x00\x12\x0c\n\x08PASSWORD\x10\x01*.\n\x07Version\x12\n\n\x06SOCKS5\x10\x00\x12\n\n\x06SOCKS4\x10\x01\x12\x0b\n\x07SOCKS4A\x10\x02\x42R\n\x14\x63om.xray.proxy.socksP\x01Z%github.com/xtls/xray-core/proxy/socks\xaa\x02\x10Xray.Proxy.Socksb\x06proto3')
-
-_AUTHTYPE = DESCRIPTOR.enum_types_by_name['AuthType']
-AuthType = enum_type_wrapper.EnumTypeWrapper(_AUTHTYPE)
-_VERSION = DESCRIPTOR.enum_types_by_name['Version']
-Version = enum_type_wrapper.EnumTypeWrapper(_VERSION)
-NO_AUTH = 0
-PASSWORD = 1
-SOCKS5 = 0
-SOCKS4 = 1
-SOCKS4A = 2
-
-
-_ACCOUNT = DESCRIPTOR.message_types_by_name['Account']
-_SERVERCONFIG = DESCRIPTOR.message_types_by_name['ServerConfig']
-_SERVERCONFIG_ACCOUNTSENTRY = _SERVERCONFIG.nested_types_by_name['AccountsEntry']
-_CLIENTCONFIG = DESCRIPTOR.message_types_by_name['ClientConfig']
-Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), {
- 'DESCRIPTOR' : _ACCOUNT,
- '__module__' : 'proxy.socks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.socks.Account)
- })
-_sym_db.RegisterMessage(Account)
-
-ServerConfig = _reflection.GeneratedProtocolMessageType('ServerConfig', (_message.Message,), {
-
- 'AccountsEntry' : _reflection.GeneratedProtocolMessageType('AccountsEntry', (_message.Message,), {
- 'DESCRIPTOR' : _SERVERCONFIG_ACCOUNTSENTRY,
- '__module__' : 'proxy.socks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.socks.ServerConfig.AccountsEntry)
- })
- ,
- 'DESCRIPTOR' : _SERVERCONFIG,
- '__module__' : 'proxy.socks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.socks.ServerConfig)
- })
-_sym_db.RegisterMessage(ServerConfig)
-_sym_db.RegisterMessage(ServerConfig.AccountsEntry)
-
-ClientConfig = _reflection.GeneratedProtocolMessageType('ClientConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CLIENTCONFIG,
- '__module__' : 'proxy.socks.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.socks.ClientConfig)
- })
-_sym_db.RegisterMessage(ClientConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\024com.xray.proxy.socksP\001Z%github.com/xtls/xray-core/proxy/socks\252\002\020Xray.Proxy.Socks'
- _SERVERCONFIG_ACCOUNTSENTRY._options = None
- _SERVERCONFIG_ACCOUNTSENTRY._serialized_options = b'8\001'
- _SERVERCONFIG.fields_by_name['timeout']._options = None
- _SERVERCONFIG.fields_by_name['timeout']._serialized_options = b'\030\001'
- _AUTHTYPE._serialized_start=553
- _AUTHTYPE._serialized_end=590
- _VERSION._serialized_start=592
- _VERSION._serialized_end=638
- _ACCOUNT._serialized_start=107
- _ACCOUNT._serialized_end=152
- _SERVERCONFIG._serialized_start=155
- _SERVERCONFIG._serialized_end=437
- _SERVERCONFIG_ACCOUNTSENTRY._serialized_start=390
- _SERVERCONFIG_ACCOUNTSENTRY._serialized_end=437
- _CLIENTCONFIG._serialized_start=439
- _CLIENTCONFIG._serialized_end=551
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/trojan/config_grpc.py b/xray_api/proto/proxy/trojan/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/trojan/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/trojan/config_pb2.py b/xray_api/proto/proxy/trojan/config_pb2.py
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/trojan/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import user_pb2 as common_dot_protocol_dot_user__pb2
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19proxy/trojan/config.proto\x12\x11xray.proxy.trojan\x1a\x1a\x63ommon/protocol/user.proto\x1a!common/protocol/server_spec.proto\"\x1b\n\x07\x41\x63\x63ount\x12\x10\n\x08password\x18\x01 \x01(\t\"^\n\x08\x46\x61llback\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x61lpn\x18\x02 \x01(\t\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\x0c\n\x04type\x18\x04 \x01(\t\x12\x0c\n\x04\x64\x65st\x18\x05 \x01(\t\x12\x0c\n\x04xver\x18\x06 \x01(\x04\"D\n\x0c\x43lientConfig\x12\x34\n\x06server\x18\x01 \x03(\x0b\x32$.xray.common.protocol.ServerEndpoint\"i\n\x0cServerConfig\x12)\n\x05users\x18\x01 \x03(\x0b\x32\x1a.xray.common.protocol.User\x12.\n\tfallbacks\x18\x02 \x03(\x0b\x32\x1b.xray.proxy.trojan.FallbackBU\n\x15\x63om.xray.proxy.trojanP\x01Z&github.com/xtls/xray-core/proxy/trojan\xaa\x02\x11Xray.Proxy.Trojanb\x06proto3')
-
-
-
-_ACCOUNT = DESCRIPTOR.message_types_by_name['Account']
-_FALLBACK = DESCRIPTOR.message_types_by_name['Fallback']
-_CLIENTCONFIG = DESCRIPTOR.message_types_by_name['ClientConfig']
-_SERVERCONFIG = DESCRIPTOR.message_types_by_name['ServerConfig']
-Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), {
- 'DESCRIPTOR' : _ACCOUNT,
- '__module__' : 'proxy.trojan.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.trojan.Account)
- })
-_sym_db.RegisterMessage(Account)
-
-Fallback = _reflection.GeneratedProtocolMessageType('Fallback', (_message.Message,), {
- 'DESCRIPTOR' : _FALLBACK,
- '__module__' : 'proxy.trojan.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.trojan.Fallback)
- })
-_sym_db.RegisterMessage(Fallback)
-
-ClientConfig = _reflection.GeneratedProtocolMessageType('ClientConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CLIENTCONFIG,
- '__module__' : 'proxy.trojan.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.trojan.ClientConfig)
- })
-_sym_db.RegisterMessage(ClientConfig)
-
-ServerConfig = _reflection.GeneratedProtocolMessageType('ServerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SERVERCONFIG,
- '__module__' : 'proxy.trojan.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.trojan.ServerConfig)
- })
-_sym_db.RegisterMessage(ServerConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\025com.xray.proxy.trojanP\001Z&github.com/xtls/xray-core/proxy/trojan\252\002\021Xray.Proxy.Trojan'
- _ACCOUNT._serialized_start=111
- _ACCOUNT._serialized_end=138
- _FALLBACK._serialized_start=140
- _FALLBACK._serialized_end=234
- _CLIENTCONFIG._serialized_start=236
- _CLIENTCONFIG._serialized_end=304
- _SERVERCONFIG._serialized_start=306
- _SERVERCONFIG._serialized_end=411
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vless/account_grpc.py b/xray_api/proto/proxy/vless/account_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vless/account.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vless/account_pb2.py b/xray_api/proto/proxy/vless/account_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vless/account.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19proxy/vless/account.proto\x12\x10xray.proxy.vless\"7\n\x07\x41\x63\x63ount\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04\x66low\x18\x02 \x01(\t\x12\x12\n\nencryption\x18\x03 \x01(\tBR\n\x14\x63om.xray.proxy.vlessP\x01Z%github.com/xtls/xray-core/proxy/vless\xaa\x02\x10Xray.Proxy.Vlessb\x06proto3')
-
-
-
-_ACCOUNT = DESCRIPTOR.message_types_by_name['Account']
-Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), {
- 'DESCRIPTOR' : _ACCOUNT,
- '__module__' : 'proxy.vless.account_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vless.Account)
- })
-_sym_db.RegisterMessage(Account)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\024com.xray.proxy.vlessP\001Z%github.com/xtls/xray-core/proxy/vless\252\002\020Xray.Proxy.Vless'
- _ACCOUNT._serialized_start=47
- _ACCOUNT._serialized_end=102
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vless/encoding/addons_grpc.py b/xray_api/proto/proxy/vless/encoding/addons_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vless/encoding/addons.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vless/encoding/addons_pb2.py b/xray_api/proto/proxy/vless/encoding/addons_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vless/encoding/addons.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!proxy/vless/encoding/addons.proto\x12\x19xray.proxy.vless.encoding\"$\n\x06\x41\x64\x64ons\x12\x0c\n\x04\x46low\x18\x01 \x01(\t\x12\x0c\n\x04Seed\x18\x02 \x01(\x0c\x42m\n\x1d\x63om.xray.proxy.vless.encodingP\x01Z.github.com/xtls/xray-core/proxy/vless/encoding\xaa\x02\x19Xray.Proxy.Vless.Encodingb\x06proto3')
-
-
-
-_ADDONS = DESCRIPTOR.message_types_by_name['Addons']
-Addons = _reflection.GeneratedProtocolMessageType('Addons', (_message.Message,), {
- 'DESCRIPTOR' : _ADDONS,
- '__module__' : 'proxy.vless.encoding.addons_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vless.encoding.Addons)
- })
-_sym_db.RegisterMessage(Addons)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\035com.xray.proxy.vless.encodingP\001Z.github.com/xtls/xray-core/proxy/vless/encoding\252\002\031Xray.Proxy.Vless.Encoding'
- _ADDONS._serialized_start=64
- _ADDONS._serialized_end=100
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vless/inbound/config_grpc.py b/xray_api/proto/proxy/vless/inbound/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vless/inbound/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vless/inbound/config_pb2.py b/xray_api/proto/proxy/vless/inbound/config_pb2.py
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vless/inbound/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import user_pb2 as common_dot_protocol_dot_user__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n proxy/vless/inbound/config.proto\x12\x18xray.proxy.vless.inbound\x1a\x1a\x63ommon/protocol/user.proto\"^\n\x08\x46\x61llback\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x61lpn\x18\x02 \x01(\t\x12\x0c\n\x04path\x18\x03 \x01(\t\x12\x0c\n\x04type\x18\x04 \x01(\t\x12\x0c\n\x04\x64\x65st\x18\x05 \x01(\t\x12\x0c\n\x04xver\x18\x06 \x01(\x04\"\x80\x01\n\x06\x43onfig\x12+\n\x07\x63lients\x18\x01 \x03(\x0b\x32\x1a.xray.common.protocol.User\x12\x12\n\ndecryption\x18\x02 \x01(\t\x12\x35\n\tfallbacks\x18\x03 \x03(\x0b\x32\".xray.proxy.vless.inbound.FallbackBj\n\x1c\x63om.xray.proxy.vless.inboundP\x01Z-github.com/xtls/xray-core/proxy/vless/inbound\xaa\x02\x18Xray.Proxy.Vless.Inboundb\x06proto3')
-
-
-
-_FALLBACK = DESCRIPTOR.message_types_by_name['Fallback']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Fallback = _reflection.GeneratedProtocolMessageType('Fallback', (_message.Message,), {
- 'DESCRIPTOR' : _FALLBACK,
- '__module__' : 'proxy.vless.inbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vless.inbound.Fallback)
- })
-_sym_db.RegisterMessage(Fallback)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.vless.inbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vless.inbound.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\034com.xray.proxy.vless.inboundP\001Z-github.com/xtls/xray-core/proxy/vless/inbound\252\002\030Xray.Proxy.Vless.Inbound'
- _FALLBACK._serialized_start=90
- _FALLBACK._serialized_end=184
- _CONFIG._serialized_start=187
- _CONFIG._serialized_end=315
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vless/outbound/config_grpc.py b/xray_api/proto/proxy/vless/outbound/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vless/outbound/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vless/outbound/config_pb2.py b/xray_api/proto/proxy/vless/outbound/config_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vless/outbound/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!proxy/vless/outbound/config.proto\x12\x19xray.proxy.vless.outbound\x1a!common/protocol/server_spec.proto\"=\n\x06\x43onfig\x12\x33\n\x05vnext\x18\x01 \x03(\x0b\x32$.xray.common.protocol.ServerEndpointBm\n\x1d\x63om.xray.proxy.vless.outboundP\x01Z.github.com/xtls/xray-core/proxy/vless/outbound\xaa\x02\x19Xray.Proxy.Vless.Outboundb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.vless.outbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vless.outbound.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\035com.xray.proxy.vless.outboundP\001Z.github.com/xtls/xray-core/proxy/vless/outbound\252\002\031Xray.Proxy.Vless.Outbound'
- _CONFIG._serialized_start=99
- _CONFIG._serialized_end=160
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vmess/account_grpc.py b/xray_api/proto/proxy/vmess/account_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vmess/account.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vmess/account_pb2.py b/xray_api/proto/proxy/vmess/account_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vmess/account.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import headers_pb2 as common_dot_protocol_dot_headers__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19proxy/vmess/account.proto\x12\x10xray.proxy.vmess\x1a\x1d\x63ommon/protocol/headers.proto\"m\n\x07\x41\x63\x63ount\x12\n\n\x02id\x18\x01 \x01(\t\x12?\n\x11security_settings\x18\x03 \x01(\x0b\x32$.xray.common.protocol.SecurityConfig\x12\x15\n\rtests_enabled\x18\x04 \x01(\tBR\n\x14\x63om.xray.proxy.vmessP\x01Z%github.com/xtls/xray-core/proxy/vmess\xaa\x02\x10Xray.Proxy.Vmessb\x06proto3')
-
-
-
-_ACCOUNT = DESCRIPTOR.message_types_by_name['Account']
-Account = _reflection.GeneratedProtocolMessageType('Account', (_message.Message,), {
- 'DESCRIPTOR' : _ACCOUNT,
- '__module__' : 'proxy.vmess.account_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vmess.Account)
- })
-_sym_db.RegisterMessage(Account)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\024com.xray.proxy.vmessP\001Z%github.com/xtls/xray-core/proxy/vmess\252\002\020Xray.Proxy.Vmess'
- _ACCOUNT._serialized_start=78
- _ACCOUNT._serialized_end=187
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vmess/inbound/config_grpc.py b/xray_api/proto/proxy/vmess/inbound/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vmess/inbound/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vmess/inbound/config_pb2.py b/xray_api/proto/proxy/vmess/inbound/config_pb2.py
@@ -1,56 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vmess/inbound/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import user_pb2 as common_dot_protocol_dot_user__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n proxy/vmess/inbound/config.proto\x12\x18xray.proxy.vmess.inbound\x1a\x1a\x63ommon/protocol/user.proto\"\x1a\n\x0c\x44\x65tourConfig\x12\n\n\x02to\x18\x01 \x01(\t\"\x1e\n\rDefaultConfig\x12\r\n\x05level\x18\x02 \x01(\r\"\xa4\x01\n\x06\x43onfig\x12(\n\x04user\x18\x01 \x03(\x0b\x32\x1a.xray.common.protocol.User\x12\x38\n\x07\x64\x65\x66\x61ult\x18\x02 \x01(\x0b\x32\'.xray.proxy.vmess.inbound.DefaultConfig\x12\x36\n\x06\x64\x65tour\x18\x03 \x01(\x0b\x32&.xray.proxy.vmess.inbound.DetourConfigBj\n\x1c\x63om.xray.proxy.vmess.inboundP\x01Z-github.com/xtls/xray-core/proxy/vmess/inbound\xaa\x02\x18Xray.Proxy.Vmess.Inboundb\x06proto3')
-
-
-
-_DETOURCONFIG = DESCRIPTOR.message_types_by_name['DetourConfig']
-_DEFAULTCONFIG = DESCRIPTOR.message_types_by_name['DefaultConfig']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-DetourConfig = _reflection.GeneratedProtocolMessageType('DetourConfig', (_message.Message,), {
- 'DESCRIPTOR' : _DETOURCONFIG,
- '__module__' : 'proxy.vmess.inbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vmess.inbound.DetourConfig)
- })
-_sym_db.RegisterMessage(DetourConfig)
-
-DefaultConfig = _reflection.GeneratedProtocolMessageType('DefaultConfig', (_message.Message,), {
- 'DESCRIPTOR' : _DEFAULTCONFIG,
- '__module__' : 'proxy.vmess.inbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vmess.inbound.DefaultConfig)
- })
-_sym_db.RegisterMessage(DefaultConfig)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.vmess.inbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vmess.inbound.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\034com.xray.proxy.vmess.inboundP\001Z-github.com/xtls/xray-core/proxy/vmess/inbound\252\002\030Xray.Proxy.Vmess.Inbound'
- _DETOURCONFIG._serialized_start=90
- _DETOURCONFIG._serialized_end=116
- _DEFAULTCONFIG._serialized_start=118
- _DEFAULTCONFIG._serialized_end=148
- _CONFIG._serialized_start=151
- _CONFIG._serialized_end=315
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/vmess/outbound/config_grpc.py b/xray_api/proto/proxy/vmess/outbound/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/vmess/outbound/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/vmess/outbound/config_pb2.py b/xray_api/proto/proxy/vmess/outbound/config_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/vmess/outbound/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.protocol import server_spec_pb2 as common_dot_protocol_dot_server__spec__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!proxy/vmess/outbound/config.proto\x12\x19xray.proxy.vmess.outbound\x1a!common/protocol/server_spec.proto\"@\n\x06\x43onfig\x12\x36\n\x08Receiver\x18\x01 \x03(\x0b\x32$.xray.common.protocol.ServerEndpointBm\n\x1d\x63om.xray.proxy.vmess.outboundP\x01Z.github.com/xtls/xray-core/proxy/vmess/outbound\xaa\x02\x19Xray.Proxy.Vmess.Outboundb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'proxy.vmess.outbound.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.vmess.outbound.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\035com.xray.proxy.vmess.outboundP\001Z.github.com/xtls/xray-core/proxy/vmess/outbound\252\002\031Xray.Proxy.Vmess.Outbound'
- _CONFIG._serialized_start=99
- _CONFIG._serialized_end=163
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/proxy/wireguard/config_grpc.py b/xray_api/proto/proxy/wireguard/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: proxy/wireguard/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/proxy/wireguard/config_pb2.py b/xray_api/proto/proxy/wireguard/config_pb2.py
@@ -1,48 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: proxy/wireguard/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cproxy/wireguard/config.proto\x12\x14xray.proxy.wireguard\"s\n\nPeerConfig\x12\x12\n\npublic_key\x18\x01 \x01(\t\x12\x16\n\x0epre_shared_key\x18\x02 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x03 \x01(\t\x12\x12\n\nkeep_alive\x18\x04 \x01(\r\x12\x13\n\x0b\x61llowed_ips\x18\x05 \x03(\t\"\xeb\x02\n\x0c\x44\x65viceConfig\x12\x12\n\nsecret_key\x18\x01 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x02 \x03(\t\x12/\n\x05peers\x18\x03 \x03(\x0b\x32 .xray.proxy.wireguard.PeerConfig\x12\x0b\n\x03mtu\x18\x04 \x01(\x05\x12\x13\n\x0bnum_workers\x18\x05 \x01(\x05\x12\x10\n\x08reserved\x18\x06 \x01(\x0c\x12J\n\x0f\x64omain_strategy\x18\x07 \x01(\x0e\x32\x31.xray.proxy.wireguard.DeviceConfig.DomainStrategy\x12\x11\n\tis_client\x18\x08 \x01(\x08\x12\x13\n\x0bkernel_mode\x18\t \x01(\x08\"\\\n\x0e\x44omainStrategy\x12\x0c\n\x08\x46ORCE_IP\x10\x00\x12\r\n\tFORCE_IP4\x10\x01\x12\r\n\tFORCE_IP6\x10\x02\x12\x0e\n\nFORCE_IP46\x10\x03\x12\x0e\n\nFORCE_IP64\x10\x04\x42^\n\x18\x63om.xray.proxy.wireguardP\x01Z)github.com/xtls/xray-core/proxy/wireguard\xaa\x02\x14Xray.Proxy.WireGuardb\x06proto3')
-
-
-
-_PEERCONFIG = DESCRIPTOR.message_types_by_name['PeerConfig']
-_DEVICECONFIG = DESCRIPTOR.message_types_by_name['DeviceConfig']
-_DEVICECONFIG_DOMAINSTRATEGY = _DEVICECONFIG.enum_types_by_name['DomainStrategy']
-PeerConfig = _reflection.GeneratedProtocolMessageType('PeerConfig', (_message.Message,), {
- 'DESCRIPTOR' : _PEERCONFIG,
- '__module__' : 'proxy.wireguard.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.wireguard.PeerConfig)
- })
-_sym_db.RegisterMessage(PeerConfig)
-
-DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICECONFIG,
- '__module__' : 'proxy.wireguard.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.proxy.wireguard.DeviceConfig)
- })
-_sym_db.RegisterMessage(DeviceConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\030com.xray.proxy.wireguardP\001Z)github.com/xtls/xray-core/proxy/wireguard\252\002\024Xray.Proxy.WireGuard'
- _PEERCONFIG._serialized_start=54
- _PEERCONFIG._serialized_end=169
- _DEVICECONFIG._serialized_start=172
- _DEVICECONFIG._serialized_end=535
- _DEVICECONFIG_DOMAINSTRATEGY._serialized_start=443
- _DEVICECONFIG_DOMAINSTRATEGY._serialized_end=535
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/global/config_grpc.py b/xray_api/proto/transport/global/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/global/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/global/config_pb2.py b/xray_api/proto/transport/global/config_pb2.py
@@ -1,38 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/global/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.transport.internet import config_pb2 as transport_dot_internet_dot_config__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dtransport/global/config.proto\x12\x0exray.transport\x1a\x1ftransport/internet/config.proto\"R\n\x06\x43onfig\x12\x44\n\x12transport_settings\x18\x01 \x03(\x0b\x32(.xray.transport.internet.TransportConfig:\x02\x18\x01\x42\x61\n\x19\x63om.xray.transport.globalP\x01Z*github.com/xtls/xray-core/transport/global\xaa\x02\x15Xray.Transport.Globalb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.global.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\031com.xray.transport.globalP\001Z*github.com/xtls/xray-core/transport/global\252\002\025Xray.Transport.Global'
- _CONFIG._options = None
- _CONFIG._serialized_options = b'\030\001'
- _CONFIG._serialized_start=82
- _CONFIG._serialized_end=164
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/config_grpc.py b/xray_api/proto/transport/internet/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/config_pb2.py b/xray_api/proto/transport/internet/config_pb2.py
@@ -1,99 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ftransport/internet/config.proto\x12\x17xray.transport.internet\x1a!common/serial/typed_message.proto\"\x9e\x01\n\x0fTransportConfig\x12@\n\x08protocol\x18\x01 \x01(\x0e\x32*.xray.transport.internet.TransportProtocolB\x02\x18\x01\x12\x15\n\rprotocol_name\x18\x03 \x01(\t\x12\x32\n\x08settings\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\"\xc1\x02\n\x0cStreamConfig\x12@\n\x08protocol\x18\x01 \x01(\x0e\x32*.xray.transport.internet.TransportProtocolB\x02\x18\x01\x12\x15\n\rprotocol_name\x18\x05 \x01(\t\x12\x44\n\x12transport_settings\x18\x02 \x03(\x0b\x32(.xray.transport.internet.TransportConfig\x12\x15\n\rsecurity_type\x18\x03 \x01(\t\x12;\n\x11security_settings\x18\x04 \x03(\x0b\x32 .xray.common.serial.TypedMessage\x12>\n\x0fsocket_settings\x18\x06 \x01(\x0b\x32%.xray.transport.internet.SocketConfig\"7\n\x0bProxyConfig\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x1b\n\x13transportLayerProxy\x18\x02 \x01(\x08\"\xce\x04\n\x0cSocketConfig\x12\x0c\n\x04mark\x18\x01 \x01(\x05\x12\x0b\n\x03tfo\x18\x02 \x01(\x05\x12@\n\x06tproxy\x18\x03 \x01(\x0e\x32\x30.xray.transport.internet.SocketConfig.TProxyMode\x12%\n\x1dreceive_original_dest_address\x18\x04 \x01(\x08\x12\x14\n\x0c\x62ind_address\x18\x05 \x01(\x0c\x12\x11\n\tbind_port\x18\x06 \x01(\r\x12\x1d\n\x15\x61\x63\x63\x65pt_proxy_protocol\x18\x07 \x01(\x08\x12@\n\x0f\x64omain_strategy\x18\x08 \x01(\x0e\x32\'.xray.transport.internet.DomainStrategy\x12\x14\n\x0c\x64ialer_proxy\x18\t \x01(\t\x12\x1f\n\x17tcp_keep_alive_interval\x18\n \x01(\x05\x12\x1b\n\x13tcp_keep_alive_idle\x18\x0b \x01(\x05\x12\x16\n\x0etcp_congestion\x18\x0c \x01(\t\x12\x11\n\tinterface\x18\r \x01(\t\x12\x0e\n\x06v6only\x18\x0e \x01(\x08\x12\x18\n\x10tcp_window_clamp\x18\x0f \x01(\x05\x12\x18\n\x10tcp_user_timeout\x18\x10 \x01(\x05\x12\x13\n\x0btcp_max_seg\x18\x11 \x01(\x05\x12\x14\n\x0ctcp_no_delay\x18\x12 \x01(\x08\x12\x11\n\ttcp_mptcp\x18\x13 \x01(\x08\"/\n\nTProxyMode\x12\x07\n\x03Off\x10\x00\x12\n\n\x06TProxy\x10\x01\x12\x0c\n\x08Redirect\x10\x02*Z\n\x11TransportProtocol\x12\x07\n\x03TCP\x10\x00\x12\x07\n\x03UDP\x10\x01\x12\x08\n\x04MKCP\x10\x02\x12\r\n\tWebSocket\x10\x03\x12\x08\n\x04HTTP\x10\x04\x12\x10\n\x0c\x44omainSocket\x10\x05*\xa9\x01\n\x0e\x44omainStrategy\x12\t\n\x05\x41S_IS\x10\x00\x12\n\n\x06USE_IP\x10\x01\x12\x0b\n\x07USE_IP4\x10\x02\x12\x0b\n\x07USE_IP6\x10\x03\x12\x0c\n\x08USE_IP46\x10\x04\x12\x0c\n\x08USE_IP64\x10\x05\x12\x0c\n\x08\x46ORCE_IP\x10\x06\x12\r\n\tFORCE_IP4\x10\x07\x12\r\n\tFORCE_IP6\x10\x08\x12\x0e\n\nFORCE_IP46\x10\t\x12\x0e\n\nFORCE_IP64\x10\nBg\n\x1b\x63om.xray.transport.internetP\x01Z,github.com/xtls/xray-core/transport/internet\xaa\x02\x17Xray.Transport.Internetb\x06proto3')
-
-_TRANSPORTPROTOCOL = DESCRIPTOR.enum_types_by_name['TransportProtocol']
-TransportProtocol = enum_type_wrapper.EnumTypeWrapper(_TRANSPORTPROTOCOL)
-_DOMAINSTRATEGY = DESCRIPTOR.enum_types_by_name['DomainStrategy']
-DomainStrategy = enum_type_wrapper.EnumTypeWrapper(_DOMAINSTRATEGY)
-TCP = 0
-UDP = 1
-MKCP = 2
-WebSocket = 3
-HTTP = 4
-DomainSocket = 5
-AS_IS = 0
-USE_IP = 1
-USE_IP4 = 2
-USE_IP6 = 3
-USE_IP46 = 4
-USE_IP64 = 5
-FORCE_IP = 6
-FORCE_IP4 = 7
-FORCE_IP6 = 8
-FORCE_IP46 = 9
-FORCE_IP64 = 10
-
-
-_TRANSPORTCONFIG = DESCRIPTOR.message_types_by_name['TransportConfig']
-_STREAMCONFIG = DESCRIPTOR.message_types_by_name['StreamConfig']
-_PROXYCONFIG = DESCRIPTOR.message_types_by_name['ProxyConfig']
-_SOCKETCONFIG = DESCRIPTOR.message_types_by_name['SocketConfig']
-_SOCKETCONFIG_TPROXYMODE = _SOCKETCONFIG.enum_types_by_name['TProxyMode']
-TransportConfig = _reflection.GeneratedProtocolMessageType('TransportConfig', (_message.Message,), {
- 'DESCRIPTOR' : _TRANSPORTCONFIG,
- '__module__' : 'transport.internet.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.TransportConfig)
- })
-_sym_db.RegisterMessage(TransportConfig)
-
-StreamConfig = _reflection.GeneratedProtocolMessageType('StreamConfig', (_message.Message,), {
- 'DESCRIPTOR' : _STREAMCONFIG,
- '__module__' : 'transport.internet.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.StreamConfig)
- })
-_sym_db.RegisterMessage(StreamConfig)
-
-ProxyConfig = _reflection.GeneratedProtocolMessageType('ProxyConfig', (_message.Message,), {
- 'DESCRIPTOR' : _PROXYCONFIG,
- '__module__' : 'transport.internet.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.ProxyConfig)
- })
-_sym_db.RegisterMessage(ProxyConfig)
-
-SocketConfig = _reflection.GeneratedProtocolMessageType('SocketConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SOCKETCONFIG,
- '__module__' : 'transport.internet.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.SocketConfig)
- })
-_sym_db.RegisterMessage(SocketConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\033com.xray.transport.internetP\001Z,github.com/xtls/xray-core/transport/internet\252\002\027Xray.Transport.Internet'
- _TRANSPORTCONFIG.fields_by_name['protocol']._options = None
- _TRANSPORTCONFIG.fields_by_name['protocol']._serialized_options = b'\030\001'
- _STREAMCONFIG.fields_by_name['protocol']._options = None
- _STREAMCONFIG.fields_by_name['protocol']._serialized_options = b'\030\001'
- _TRANSPORTPROTOCOL._serialized_start=1230
- _TRANSPORTPROTOCOL._serialized_end=1320
- _DOMAINSTRATEGY._serialized_start=1323
- _DOMAINSTRATEGY._serialized_end=1492
- _TRANSPORTCONFIG._serialized_start=96
- _TRANSPORTCONFIG._serialized_end=254
- _STREAMCONFIG._serialized_start=257
- _STREAMCONFIG._serialized_end=578
- _PROXYCONFIG._serialized_start=580
- _PROXYCONFIG._serialized_end=635
- _SOCKETCONFIG._serialized_start=638
- _SOCKETCONFIG._serialized_end=1228
- _SOCKETCONFIG_TPROXYMODE._serialized_start=1181
- _SOCKETCONFIG_TPROXYMODE._serialized_end=1228
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/domainsocket/config_grpc.py b/xray_api/proto/transport/internet/domainsocket/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/domainsocket/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/domainsocket/config_pb2.py b/xray_api/proto/transport/internet/domainsocket/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/domainsocket/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,transport/internet/domainsocket/config.proto\x12$xray.transport.internet.domainsocket\"9\n\x06\x43onfig\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x10\n\x08\x61\x62stract\x18\x02 \x01(\x08\x12\x0f\n\x07padding\x18\x03 \x01(\x08\x42\x8e\x01\n(com.xray.transport.internet.domainsocketP\x01Z9github.com/xtls/xray-core/transport/internet/domainsocket\xaa\x02$Xray.Transport.Internet.DomainSocketb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.domainsocket.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.domainsocket.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n(com.xray.transport.internet.domainsocketP\001Z9github.com/xtls/xray-core/transport/internet/domainsocket\252\002$Xray.Transport.Internet.DomainSocket'
- _CONFIG._serialized_start=86
- _CONFIG._serialized_end=143
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/grpc/config_grpc.py b/xray_api/proto/transport/internet/grpc/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/grpc/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/grpc/config_pb2.py b/xray_api/proto/transport/internet/grpc/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/grpc/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$transport/internet/grpc/config.proto\x12%xray.transport.internet.grpc.encoding\"\xc5\x01\n\x06\x43onfig\x12\x0c\n\x04host\x18\x01 \x01(\t\x12\x14\n\x0cservice_name\x18\x02 \x01(\t\x12\x12\n\nmulti_mode\x18\x03 \x01(\x08\x12\x14\n\x0cidle_timeout\x18\x04 \x01(\x05\x12\x1c\n\x14health_check_timeout\x18\x05 \x01(\x05\x12\x1d\n\x15permit_without_stream\x18\x06 \x01(\x08\x12\x1c\n\x14initial_windows_size\x18\x07 \x01(\x05\x12\x12\n\nuser_agent\x18\x08 \x01(\tB3Z1github.com/xtls/xray-core/transport/internet/grpcb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.grpc.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.grpc.encoding.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'Z1github.com/xtls/xray-core/transport/internet/grpc'
- _CONFIG._serialized_start=80
- _CONFIG._serialized_end=277
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/grpc/encoding/stream_grpc.py b/xray_api/proto/transport/internet/grpc/encoding/stream_grpc.py
@@ -1,56 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/grpc/encoding/stream.proto
-# plugin: grpclib.plugin.main
-import abc
-import typing
-
-import grpclib.const
-import grpclib.client
-if typing.TYPE_CHECKING:
- import grpclib.server
-
-import xray_api.proto.transport.internet.grpc.encoding.stream_pb2
-
-
-class GRPCServiceBase(abc.ABC):
-
- @abc.abstractmethod
- async def Tun(self, stream: 'grpclib.server.Stream[transport.internet.grpc.encoding.stream_pb2.Hunk, transport.internet.grpc.encoding.stream_pb2.Hunk]') -> None:
- pass
-
- @abc.abstractmethod
- async def TunMulti(self, stream: 'grpclib.server.Stream[transport.internet.grpc.encoding.stream_pb2.MultiHunk, transport.internet.grpc.encoding.stream_pb2.MultiHunk]') -> None:
- pass
-
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
- return {
- '/xray.transport.internet.grpc.encoding.GRPCService/Tun': grpclib.const.Handler(
- self.Tun,
- grpclib.const.Cardinality.STREAM_STREAM,
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.Hunk,
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.Hunk,
- ),
- '/xray.transport.internet.grpc.encoding.GRPCService/TunMulti': grpclib.const.Handler(
- self.TunMulti,
- grpclib.const.Cardinality.STREAM_STREAM,
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.MultiHunk,
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.MultiHunk,
- ),
- }
-
-
-class GRPCServiceStub:
-
- def __init__(self, channel: grpclib.client.Channel) -> None:
- self.Tun = grpclib.client.StreamStreamMethod(
- channel,
- '/xray.transport.internet.grpc.encoding.GRPCService/Tun',
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.Hunk,
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.Hunk,
- )
- self.TunMulti = grpclib.client.StreamStreamMethod(
- channel,
- '/xray.transport.internet.grpc.encoding.GRPCService/TunMulti',
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.MultiHunk,
- xray_api.proto.transport.internet.grpc.encoding.stream_pb2.MultiHunk,
- )
diff --git a/xray_api/proto/transport/internet/grpc/encoding/stream_pb2.py b/xray_api/proto/transport/internet/grpc/encoding/stream_pb2.py
@@ -1,48 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/grpc/encoding/stream.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-transport/internet/grpc/encoding/stream.proto\x12%xray.transport.internet.grpc.encoding\"\x14\n\x04Hunk\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"\x19\n\tMultiHunk\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x0c\x32\xe6\x01\n\x0bGRPCService\x12\x63\n\x03Tun\x12+.xray.transport.internet.grpc.encoding.Hunk\x1a+.xray.transport.internet.grpc.encoding.Hunk(\x01\x30\x01\x12r\n\x08TunMulti\x12\x30.xray.transport.internet.grpc.encoding.MultiHunk\x1a\x30.xray.transport.internet.grpc.encoding.MultiHunk(\x01\x30\x01\x42<Z:github.com/xtls/xray-core/transport/internet/grpc/encodingb\x06proto3')
-
-
-
-_HUNK = DESCRIPTOR.message_types_by_name['Hunk']
-_MULTIHUNK = DESCRIPTOR.message_types_by_name['MultiHunk']
-Hunk = _reflection.GeneratedProtocolMessageType('Hunk', (_message.Message,), {
- 'DESCRIPTOR' : _HUNK,
- '__module__' : 'transport.internet.grpc.encoding.stream_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.grpc.encoding.Hunk)
- })
-_sym_db.RegisterMessage(Hunk)
-
-MultiHunk = _reflection.GeneratedProtocolMessageType('MultiHunk', (_message.Message,), {
- 'DESCRIPTOR' : _MULTIHUNK,
- '__module__' : 'transport.internet.grpc.encoding.stream_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.grpc.encoding.MultiHunk)
- })
-_sym_db.RegisterMessage(MultiHunk)
-
-_GRPCSERVICE = DESCRIPTOR.services_by_name['GRPCService']
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'Z:github.com/xtls/xray-core/transport/internet/grpc/encoding'
- _HUNK._serialized_start=88
- _HUNK._serialized_end=108
- _MULTIHUNK._serialized_start=110
- _MULTIHUNK._serialized_end=135
- _GRPCSERVICE._serialized_start=138
- _GRPCSERVICE._serialized_end=368
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/dns/config_grpc.py b/xray_api/proto/transport/internet/headers/dns/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/dns/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/dns/config_pb2.py b/xray_api/proto/transport/internet/headers/dns/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/dns/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+transport/internet/headers/dns/config.proto\x12#xray.transport.internet.headers.dns\"\x18\n\x06\x43onfig\x12\x0e\n\x06\x64omain\x18\x01 \x01(\tB\x8b\x01\n\'com.xray.transport.internet.headers.dnsP\x01Z8github.com/xtls/xray-core/transport/internet/headers/dns\xaa\x02#Xray.Transport.Internet.Headers.DNSb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.headers.dns.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.dns.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\'com.xray.transport.internet.headers.dnsP\001Z8github.com/xtls/xray-core/transport/internet/headers/dns\252\002#Xray.Transport.Internet.Headers.DNS'
- _CONFIG._serialized_start=84
- _CONFIG._serialized_end=108
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/http/config_grpc.py b/xray_api/proto/transport/internet/headers/http/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/http/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/http/config_pb2.py b/xray_api/proto/transport/internet/headers/http/config_pb2.py
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/http/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,transport/internet/headers/http/config.proto\x12$xray.transport.internet.headers.http\"%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x03(\t\"\x18\n\x07Version\x12\r\n\x05value\x18\x01 \x01(\t\"\x17\n\x06Method\x12\r\n\x05value\x18\x01 \x01(\t\"\xd8\x01\n\rRequestConfig\x12>\n\x07version\x18\x01 \x01(\x0b\x32-.xray.transport.internet.headers.http.Version\x12<\n\x06method\x18\x02 \x01(\x0b\x32,.xray.transport.internet.headers.http.Method\x12\x0b\n\x03uri\x18\x03 \x03(\t\x12<\n\x06header\x18\x04 \x03(\x0b\x32,.xray.transport.internet.headers.http.Header\"&\n\x06Status\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x0e\n\x06reason\x18\x02 \x01(\t\"\xcc\x01\n\x0eResponseConfig\x12>\n\x07version\x18\x01 \x01(\x0b\x32-.xray.transport.internet.headers.http.Version\x12<\n\x06status\x18\x02 \x01(\x0b\x32,.xray.transport.internet.headers.http.Status\x12<\n\x06header\x18\x03 \x03(\x0b\x32,.xray.transport.internet.headers.http.Header\"\x96\x01\n\x06\x43onfig\x12\x44\n\x07request\x18\x01 \x01(\x0b\x32\x33.xray.transport.internet.headers.http.RequestConfig\x12\x46\n\x08response\x18\x02 \x01(\x0b\x32\x34.xray.transport.internet.headers.http.ResponseConfigB\x8e\x01\n(com.xray.transport.internet.headers.httpP\x01Z9github.com/xtls/xray-core/transport/internet/headers/http\xaa\x02$Xray.Transport.Internet.Headers.Httpb\x06proto3')
-
-
-
-_HEADER = DESCRIPTOR.message_types_by_name['Header']
-_VERSION = DESCRIPTOR.message_types_by_name['Version']
-_METHOD = DESCRIPTOR.message_types_by_name['Method']
-_REQUESTCONFIG = DESCRIPTOR.message_types_by_name['RequestConfig']
-_STATUS = DESCRIPTOR.message_types_by_name['Status']
-_RESPONSECONFIG = DESCRIPTOR.message_types_by_name['ResponseConfig']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Header = _reflection.GeneratedProtocolMessageType('Header', (_message.Message,), {
- 'DESCRIPTOR' : _HEADER,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.Header)
- })
-_sym_db.RegisterMessage(Header)
-
-Version = _reflection.GeneratedProtocolMessageType('Version', (_message.Message,), {
- 'DESCRIPTOR' : _VERSION,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.Version)
- })
-_sym_db.RegisterMessage(Version)
-
-Method = _reflection.GeneratedProtocolMessageType('Method', (_message.Message,), {
- 'DESCRIPTOR' : _METHOD,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.Method)
- })
-_sym_db.RegisterMessage(Method)
-
-RequestConfig = _reflection.GeneratedProtocolMessageType('RequestConfig', (_message.Message,), {
- 'DESCRIPTOR' : _REQUESTCONFIG,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.RequestConfig)
- })
-_sym_db.RegisterMessage(RequestConfig)
-
-Status = _reflection.GeneratedProtocolMessageType('Status', (_message.Message,), {
- 'DESCRIPTOR' : _STATUS,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.Status)
- })
-_sym_db.RegisterMessage(Status)
-
-ResponseConfig = _reflection.GeneratedProtocolMessageType('ResponseConfig', (_message.Message,), {
- 'DESCRIPTOR' : _RESPONSECONFIG,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.ResponseConfig)
- })
-_sym_db.RegisterMessage(ResponseConfig)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.headers.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.http.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n(com.xray.transport.internet.headers.httpP\001Z9github.com/xtls/xray-core/transport/internet/headers/http\252\002$Xray.Transport.Internet.Headers.Http'
- _HEADER._serialized_start=86
- _HEADER._serialized_end=123
- _VERSION._serialized_start=125
- _VERSION._serialized_end=149
- _METHOD._serialized_start=151
- _METHOD._serialized_end=174
- _REQUESTCONFIG._serialized_start=177
- _REQUESTCONFIG._serialized_end=393
- _STATUS._serialized_start=395
- _STATUS._serialized_end=433
- _RESPONSECONFIG._serialized_start=436
- _RESPONSECONFIG._serialized_end=640
- _CONFIG._serialized_start=643
- _CONFIG._serialized_end=793
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/noop/config_grpc.py b/xray_api/proto/transport/internet/headers/noop/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/noop/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/noop/config_pb2.py b/xray_api/proto/transport/internet/headers/noop/config_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/noop/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,transport/internet/headers/noop/config.proto\x12$xray.transport.internet.headers.noop\"\x08\n\x06\x43onfig\"\x12\n\x10\x43onnectionConfigB\x8e\x01\n(com.xray.transport.internet.headers.noopP\x01Z9github.com/xtls/xray-core/transport/internet/headers/noop\xaa\x02$Xray.Transport.Internet.Headers.Noopb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CONNECTIONCONFIG = DESCRIPTOR.message_types_by_name['ConnectionConfig']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.headers.noop.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.noop.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-ConnectionConfig = _reflection.GeneratedProtocolMessageType('ConnectionConfig', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONCONFIG,
- '__module__' : 'transport.internet.headers.noop.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.noop.ConnectionConfig)
- })
-_sym_db.RegisterMessage(ConnectionConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n(com.xray.transport.internet.headers.noopP\001Z9github.com/xtls/xray-core/transport/internet/headers/noop\252\002$Xray.Transport.Internet.Headers.Noop'
- _CONFIG._serialized_start=86
- _CONFIG._serialized_end=94
- _CONNECTIONCONFIG._serialized_start=96
- _CONNECTIONCONFIG._serialized_end=114
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/srtp/config_grpc.py b/xray_api/proto/transport/internet/headers/srtp/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/srtp/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/srtp/config_pb2.py b/xray_api/proto/transport/internet/headers/srtp/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/srtp/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,transport/internet/headers/srtp/config.proto\x12$xray.transport.internet.headers.srtp\"w\n\x06\x43onfig\x12\x0f\n\x07version\x18\x01 \x01(\r\x12\x0f\n\x07padding\x18\x02 \x01(\x08\x12\x11\n\textension\x18\x03 \x01(\x08\x12\x12\n\ncsrc_count\x18\x04 \x01(\r\x12\x0e\n\x06marker\x18\x05 \x01(\x08\x12\x14\n\x0cpayload_type\x18\x06 \x01(\rB\x8e\x01\n(com.xray.transport.internet.headers.srtpP\x01Z9github.com/xtls/xray-core/transport/internet/headers/srtp\xaa\x02$Xray.Transport.Internet.Headers.Srtpb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.headers.srtp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.srtp.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n(com.xray.transport.internet.headers.srtpP\001Z9github.com/xtls/xray-core/transport/internet/headers/srtp\252\002$Xray.Transport.Internet.Headers.Srtp'
- _CONFIG._serialized_start=86
- _CONFIG._serialized_end=205
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/tls/config_grpc.py b/xray_api/proto/transport/internet/headers/tls/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/tls/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/tls/config_pb2.py b/xray_api/proto/transport/internet/headers/tls/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/tls/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+transport/internet/headers/tls/config.proto\x12#xray.transport.internet.headers.tls\"\x0e\n\x0cPacketConfigB\x8b\x01\n\'com.xray.transport.internet.headers.tlsP\x01Z8github.com/xtls/xray-core/transport/internet/headers/tls\xaa\x02#Xray.Transport.Internet.Headers.Tlsb\x06proto3')
-
-
-
-_PACKETCONFIG = DESCRIPTOR.message_types_by_name['PacketConfig']
-PacketConfig = _reflection.GeneratedProtocolMessageType('PacketConfig', (_message.Message,), {
- 'DESCRIPTOR' : _PACKETCONFIG,
- '__module__' : 'transport.internet.headers.tls.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.tls.PacketConfig)
- })
-_sym_db.RegisterMessage(PacketConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\'com.xray.transport.internet.headers.tlsP\001Z8github.com/xtls/xray-core/transport/internet/headers/tls\252\002#Xray.Transport.Internet.Headers.Tls'
- _PACKETCONFIG._serialized_start=84
- _PACKETCONFIG._serialized_end=98
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/utp/config_grpc.py b/xray_api/proto/transport/internet/headers/utp/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/utp/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/utp/config_pb2.py b/xray_api/proto/transport/internet/headers/utp/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/utp/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+transport/internet/headers/utp/config.proto\x12#xray.transport.internet.headers.utp\"\x19\n\x06\x43onfig\x12\x0f\n\x07version\x18\x01 \x01(\rB\x8b\x01\n\'com.xray.transport.internet.headers.utpP\x01Z8github.com/xtls/xray-core/transport/internet/headers/utp\xaa\x02#Xray.Transport.Internet.Headers.Utpb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.headers.utp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.utp.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\'com.xray.transport.internet.headers.utpP\001Z8github.com/xtls/xray-core/transport/internet/headers/utp\252\002#Xray.Transport.Internet.Headers.Utp'
- _CONFIG._serialized_start=84
- _CONFIG._serialized_end=109
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/wechat/config_grpc.py b/xray_api/proto/transport/internet/headers/wechat/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/wechat/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/wechat/config_pb2.py b/xray_api/proto/transport/internet/headers/wechat/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/wechat/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.transport/internet/headers/wechat/config.proto\x12&xray.transport.internet.headers.wechat\"\r\n\x0bVideoConfigB\x94\x01\n*com.xray.transport.internet.headers.wechatP\x01Z;github.com/xtls/xray-core/transport/internet/headers/wechat\xaa\x02&Xray.Transport.Internet.Headers.Wechatb\x06proto3')
-
-
-
-_VIDEOCONFIG = DESCRIPTOR.message_types_by_name['VideoConfig']
-VideoConfig = _reflection.GeneratedProtocolMessageType('VideoConfig', (_message.Message,), {
- 'DESCRIPTOR' : _VIDEOCONFIG,
- '__module__' : 'transport.internet.headers.wechat.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.wechat.VideoConfig)
- })
-_sym_db.RegisterMessage(VideoConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n*com.xray.transport.internet.headers.wechatP\001Z;github.com/xtls/xray-core/transport/internet/headers/wechat\252\002&Xray.Transport.Internet.Headers.Wechat'
- _VIDEOCONFIG._serialized_start=90
- _VIDEOCONFIG._serialized_end=103
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/headers/wireguard/config_grpc.py b/xray_api/proto/transport/internet/headers/wireguard/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/headers/wireguard/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/headers/wireguard/config_pb2.py b/xray_api/proto/transport/internet/headers/wireguard/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/headers/wireguard/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1transport/internet/headers/wireguard/config.proto\x12)xray.transport.internet.headers.wireguard\"\x11\n\x0fWireguardConfigB\x9d\x01\n-com.xray.transport.internet.headers.wireguardP\x01Z>github.com/xtls/xray-core/transport/internet/headers/wireguard\xaa\x02)Xray.Transport.Internet.Headers.Wireguardb\x06proto3')
-
-
-
-_WIREGUARDCONFIG = DESCRIPTOR.message_types_by_name['WireguardConfig']
-WireguardConfig = _reflection.GeneratedProtocolMessageType('WireguardConfig', (_message.Message,), {
- 'DESCRIPTOR' : _WIREGUARDCONFIG,
- '__module__' : 'transport.internet.headers.wireguard.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.headers.wireguard.WireguardConfig)
- })
-_sym_db.RegisterMessage(WireguardConfig)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n-com.xray.transport.internet.headers.wireguardP\001Z>github.com/xtls/xray-core/transport/internet/headers/wireguard\252\002)Xray.Transport.Internet.Headers.Wireguard'
- _WIREGUARDCONFIG._serialized_start=96
- _WIREGUARDCONFIG._serialized_end=113
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/http/config_grpc.py b/xray_api/proto/transport/internet/http/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/http/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/http/config_pb2.py b/xray_api/proto/transport/internet/http/config_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/http/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.transport.internet.headers.http import config_pb2 as transport_dot_internet_dot_headers_dot_http_dot_config__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$transport/internet/http/config.proto\x12\x1cxray.transport.internet.http\x1a,transport/internet/headers/http/config.proto\"\xa6\x01\n\x06\x43onfig\x12\x0c\n\x04host\x18\x01 \x03(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\x14\n\x0cidle_timeout\x18\x03 \x01(\x05\x12\x1c\n\x14health_check_timeout\x18\x04 \x01(\x05\x12\x0e\n\x06method\x18\x05 \x01(\t\x12<\n\x06header\x18\x06 \x03(\x0b\x32,.xray.transport.internet.headers.http.HeaderBv\n com.xray.transport.internet.httpP\x01Z1github.com/xtls/xray-core/transport/internet/http\xaa\x02\x1cXray.Transport.Internet.Httpb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.http.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.http.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n com.xray.transport.internet.httpP\001Z1github.com/xtls/xray-core/transport/internet/http\252\002\034Xray.Transport.Internet.Http'
- _CONFIG._serialized_start=117
- _CONFIG._serialized_end=283
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/kcp/config_grpc.py b/xray_api/proto/transport/internet/kcp/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/kcp/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/kcp/config_pb2.py b/xray_api/proto/transport/internet/kcp/config_pb2.py
@@ -1,116 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/kcp/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#transport/internet/kcp/config.proto\x12\x1bxray.transport.internet.kcp\x1a!common/serial/typed_message.proto\"\x14\n\x03MTU\x12\r\n\x05value\x18\x01 \x01(\r\"\x14\n\x03TTI\x12\r\n\x05value\x18\x01 \x01(\r\"\x1f\n\x0eUplinkCapacity\x12\r\n\x05value\x18\x01 \x01(\r\"!\n\x10\x44ownlinkCapacity\x12\r\n\x05value\x18\x01 \x01(\r\"\x1b\n\x0bWriteBuffer\x12\x0c\n\x04size\x18\x01 \x01(\r\"\x1a\n\nReadBuffer\x12\x0c\n\x04size\x18\x01 \x01(\r\"!\n\x0f\x43onnectionReuse\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\"\x1e\n\x0e\x45ncryptionSeed\x12\x0c\n\x04seed\x18\x01 \x01(\t\"\x82\x04\n\x06\x43onfig\x12-\n\x03mtu\x18\x01 \x01(\x0b\x32 .xray.transport.internet.kcp.MTU\x12-\n\x03tti\x18\x02 \x01(\x0b\x32 .xray.transport.internet.kcp.TTI\x12\x44\n\x0fuplink_capacity\x18\x03 \x01(\x0b\x32+.xray.transport.internet.kcp.UplinkCapacity\x12H\n\x11\x64ownlink_capacity\x18\x04 \x01(\x0b\x32-.xray.transport.internet.kcp.DownlinkCapacity\x12\x12\n\ncongestion\x18\x05 \x01(\x08\x12>\n\x0cwrite_buffer\x18\x06 \x01(\x0b\x32(.xray.transport.internet.kcp.WriteBuffer\x12<\n\x0bread_buffer\x18\x07 \x01(\x0b\x32\'.xray.transport.internet.kcp.ReadBuffer\x12\x37\n\rheader_config\x18\x08 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x39\n\x04seed\x18\n \x01(\x0b\x32+.xray.transport.internet.kcp.EncryptionSeedJ\x04\x08\t\x10\nBs\n\x1f\x63om.xray.transport.internet.kcpP\x01Z0github.com/xtls/xray-core/transport/internet/kcp\xaa\x02\x1bXray.Transport.Internet.Kcpb\x06proto3')
-
-
-
-_MTU = DESCRIPTOR.message_types_by_name['MTU']
-_TTI = DESCRIPTOR.message_types_by_name['TTI']
-_UPLINKCAPACITY = DESCRIPTOR.message_types_by_name['UplinkCapacity']
-_DOWNLINKCAPACITY = DESCRIPTOR.message_types_by_name['DownlinkCapacity']
-_WRITEBUFFER = DESCRIPTOR.message_types_by_name['WriteBuffer']
-_READBUFFER = DESCRIPTOR.message_types_by_name['ReadBuffer']
-_CONNECTIONREUSE = DESCRIPTOR.message_types_by_name['ConnectionReuse']
-_ENCRYPTIONSEED = DESCRIPTOR.message_types_by_name['EncryptionSeed']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-MTU = _reflection.GeneratedProtocolMessageType('MTU', (_message.Message,), {
- 'DESCRIPTOR' : _MTU,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.MTU)
- })
-_sym_db.RegisterMessage(MTU)
-
-TTI = _reflection.GeneratedProtocolMessageType('TTI', (_message.Message,), {
- 'DESCRIPTOR' : _TTI,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.TTI)
- })
-_sym_db.RegisterMessage(TTI)
-
-UplinkCapacity = _reflection.GeneratedProtocolMessageType('UplinkCapacity', (_message.Message,), {
- 'DESCRIPTOR' : _UPLINKCAPACITY,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.UplinkCapacity)
- })
-_sym_db.RegisterMessage(UplinkCapacity)
-
-DownlinkCapacity = _reflection.GeneratedProtocolMessageType('DownlinkCapacity', (_message.Message,), {
- 'DESCRIPTOR' : _DOWNLINKCAPACITY,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.DownlinkCapacity)
- })
-_sym_db.RegisterMessage(DownlinkCapacity)
-
-WriteBuffer = _reflection.GeneratedProtocolMessageType('WriteBuffer', (_message.Message,), {
- 'DESCRIPTOR' : _WRITEBUFFER,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.WriteBuffer)
- })
-_sym_db.RegisterMessage(WriteBuffer)
-
-ReadBuffer = _reflection.GeneratedProtocolMessageType('ReadBuffer', (_message.Message,), {
- 'DESCRIPTOR' : _READBUFFER,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.ReadBuffer)
- })
-_sym_db.RegisterMessage(ReadBuffer)
-
-ConnectionReuse = _reflection.GeneratedProtocolMessageType('ConnectionReuse', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONREUSE,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.ConnectionReuse)
- })
-_sym_db.RegisterMessage(ConnectionReuse)
-
-EncryptionSeed = _reflection.GeneratedProtocolMessageType('EncryptionSeed', (_message.Message,), {
- 'DESCRIPTOR' : _ENCRYPTIONSEED,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.EncryptionSeed)
- })
-_sym_db.RegisterMessage(EncryptionSeed)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.kcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.kcp.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\037com.xray.transport.internet.kcpP\001Z0github.com/xtls/xray-core/transport/internet/kcp\252\002\033Xray.Transport.Internet.Kcp'
- _MTU._serialized_start=103
- _MTU._serialized_end=123
- _TTI._serialized_start=125
- _TTI._serialized_end=145
- _UPLINKCAPACITY._serialized_start=147
- _UPLINKCAPACITY._serialized_end=178
- _DOWNLINKCAPACITY._serialized_start=180
- _DOWNLINKCAPACITY._serialized_end=213
- _WRITEBUFFER._serialized_start=215
- _WRITEBUFFER._serialized_end=242
- _READBUFFER._serialized_start=244
- _READBUFFER._serialized_end=270
- _CONNECTIONREUSE._serialized_start=272
- _CONNECTIONREUSE._serialized_end=305
- _ENCRYPTIONSEED._serialized_start=307
- _ENCRYPTIONSEED._serialized_end=337
- _CONFIG._serialized_start=340
- _CONFIG._serialized_end=854
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/quic/config_grpc.py b/xray_api/proto/transport/internet/quic/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/quic/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/quic/config_pb2.py b/xray_api/proto/transport/internet/quic/config_pb2.py
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/quic/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-from xray_api.proto.common.protocol import headers_pb2 as common_dot_protocol_dot_headers__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$transport/internet/quic/config.proto\x12\x1cxray.transport.internet.quic\x1a!common/serial/typed_message.proto\x1a\x1d\x63ommon/protocol/headers.proto\"\x7f\n\x06\x43onfig\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x08security\x18\x02 \x01(\x0b\x32$.xray.common.protocol.SecurityConfig\x12\x30\n\x06header\x18\x03 \x01(\x0b\x32 .xray.common.serial.TypedMessageBv\n com.xray.transport.internet.quicP\x01Z1github.com/xtls/xray-core/transport/internet/quic\xaa\x02\x1cXray.Transport.Internet.Quicb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.quic.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.quic.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n com.xray.transport.internet.quicP\001Z1github.com/xtls/xray-core/transport/internet/quic\252\002\034Xray.Transport.Internet.Quic'
- _CONFIG._serialized_start=136
- _CONFIG._serialized_end=263
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/reality/config_grpc.py b/xray_api/proto/transport/internet/reality/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/reality/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/reality/config_pb2.py b/xray_api/proto/transport/internet/reality/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/reality/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'transport/internet/reality/config.proto\x12\x1fxray.transport.internet.reality\"\xb9\x02\n\x06\x43onfig\x12\x0c\n\x04show\x18\x01 \x01(\x08\x12\x0c\n\x04\x64\x65st\x18\x02 \x01(\t\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x0c\n\x04xver\x18\x04 \x01(\x04\x12\x14\n\x0cserver_names\x18\x05 \x03(\t\x12\x13\n\x0bprivate_key\x18\x06 \x01(\x0c\x12\x16\n\x0emin_client_ver\x18\x07 \x01(\x0c\x12\x16\n\x0emax_client_ver\x18\x08 \x01(\x0c\x12\x15\n\rmax_time_diff\x18\t \x01(\x04\x12\x11\n\tshort_ids\x18\n \x03(\x0c\x12\x13\n\x0b\x46ingerprint\x18\x15 \x01(\t\x12\x13\n\x0bserver_name\x18\x16 \x01(\t\x12\x12\n\npublic_key\x18\x17 \x01(\x0c\x12\x10\n\x08short_id\x18\x18 \x01(\x0c\x12\x10\n\x08spider_x\x18\x19 \x01(\t\x12\x10\n\x08spider_y\x18\x1a \x03(\x03\x42\x7f\n#com.xray.transport.internet.realityP\x01Z4github.com/xtls/xray-core/transport/internet/reality\xaa\x02\x1fXray.Transport.Internet.Realityb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.reality.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.reality.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n#com.xray.transport.internet.realityP\001Z4github.com/xtls/xray-core/transport/internet/reality\252\002\037Xray.Transport.Internet.Reality'
- _CONFIG._serialized_start=77
- _CONFIG._serialized_end=390
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/tcp/config_grpc.py b/xray_api/proto/transport/internet/tcp/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/tcp/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/tcp/config_pb2.py b/xray_api/proto/transport/internet/tcp/config_pb2.py
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/tcp/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from xray_api.proto.common.serial import typed_message_pb2 as common_dot_serial_dot_typed__message__pb2
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#transport/internet/tcp/config.proto\x12\x1bxray.transport.internet.tcp\x1a!common/serial/typed_message.proto\"h\n\x06\x43onfig\x12\x39\n\x0fheader_settings\x18\x02 \x01(\x0b\x32 .xray.common.serial.TypedMessage\x12\x1d\n\x15\x61\x63\x63\x65pt_proxy_protocol\x18\x03 \x01(\x08J\x04\x08\x01\x10\x02\x42s\n\x1f\x63om.xray.transport.internet.tcpP\x01Z0github.com/xtls/xray-core/transport/internet/tcp\xaa\x02\x1bXray.Transport.Internet.Tcpb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.tcp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.tcp.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\037com.xray.transport.internet.tcpP\001Z0github.com/xtls/xray-core/transport/internet/tcp\252\002\033Xray.Transport.Internet.Tcp'
- _CONFIG._serialized_start=103
- _CONFIG._serialized_end=207
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/tls/config_grpc.py b/xray_api/proto/transport/internet/tls/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/tls/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/tls/config_pb2.py b/xray_api/proto/transport/internet/tls/config_pb2.py
@@ -1,48 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/tls/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#transport/internet/tls/config.proto\x12\x1bxray.transport.internet.tls\"\x91\x02\n\x0b\x43\x65rtificate\x12\x13\n\x0b\x63\x65rtificate\x18\x01 \x01(\x0c\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12=\n\x05usage\x18\x03 \x01(\x0e\x32..xray.transport.internet.tls.Certificate.Usage\x12\x15\n\rocsp_stapling\x18\x04 \x01(\x04\x12\x18\n\x10\x63\x65rtificate_path\x18\x05 \x01(\t\x12\x10\n\x08key_path\x18\x06 \x01(\t\x12\x18\n\x10One_time_loading\x18\x07 \x01(\x08\"D\n\x05Usage\x12\x10\n\x0c\x45NCIPHERMENT\x10\x00\x12\x14\n\x10\x41UTHORITY_VERIFY\x10\x01\x12\x13\n\x0f\x41UTHORITY_ISSUE\x10\x02\"\xc3\x03\n\x06\x43onfig\x12\x16\n\x0e\x61llow_insecure\x18\x01 \x01(\x08\x12=\n\x0b\x63\x65rtificate\x18\x02 \x03(\x0b\x32(.xray.transport.internet.tls.Certificate\x12\x13\n\x0bserver_name\x18\x03 \x01(\t\x12\x15\n\rnext_protocol\x18\x04 \x03(\t\x12!\n\x19\x65nable_session_resumption\x18\x05 \x01(\x08\x12\x1b\n\x13\x64isable_system_root\x18\x06 \x01(\x08\x12\x13\n\x0bmin_version\x18\x07 \x01(\t\x12\x13\n\x0bmax_version\x18\x08 \x01(\t\x12\x15\n\rcipher_suites\x18\t \x01(\t\x12#\n\x1bprefer_server_cipher_suites\x18\n \x01(\x08\x12\x13\n\x0b\x66ingerprint\x18\x0b \x01(\t\x12\x1a\n\x12reject_unknown_sni\x18\x0c \x01(\x08\x12,\n$pinned_peer_certificate_chain_sha256\x18\r \x03(\x0c\x12\x31\n)pinned_peer_certificate_public_key_sha256\x18\x0e \x03(\x0c\x42s\n\x1f\x63om.xray.transport.internet.tlsP\x01Z0github.com/xtls/xray-core/transport/internet/tls\xaa\x02\x1bXray.Transport.Internet.Tlsb\x06proto3')
-
-
-
-_CERTIFICATE = DESCRIPTOR.message_types_by_name['Certificate']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-_CERTIFICATE_USAGE = _CERTIFICATE.enum_types_by_name['Usage']
-Certificate = _reflection.GeneratedProtocolMessageType('Certificate', (_message.Message,), {
- 'DESCRIPTOR' : _CERTIFICATE,
- '__module__' : 'transport.internet.tls.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.tls.Certificate)
- })
-_sym_db.RegisterMessage(Certificate)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.tls.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.tls.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\037com.xray.transport.internet.tlsP\001Z0github.com/xtls/xray-core/transport/internet/tls\252\002\033Xray.Transport.Internet.Tls'
- _CERTIFICATE._serialized_start=69
- _CERTIFICATE._serialized_end=342
- _CERTIFICATE_USAGE._serialized_start=274
- _CERTIFICATE_USAGE._serialized_end=342
- _CONFIG._serialized_start=345
- _CONFIG._serialized_end=796
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/udp/config_grpc.py b/xray_api/proto/transport/internet/udp/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/udp/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/udp/config_pb2.py b/xray_api/proto/transport/internet/udp/config_pb2.py
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/udp/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#transport/internet/udp/config.proto\x12\x1bxray.transport.internet.udp\"\x08\n\x06\x43onfigBs\n\x1f\x63om.xray.transport.internet.udpP\x01Z0github.com/xtls/xray-core/transport/internet/udp\xaa\x02\x1bXray.Transport.Internet.Udpb\x06proto3')
-
-
-
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.udp.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.udp.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n\037com.xray.transport.internet.udpP\001Z0github.com/xtls/xray-core/transport/internet/udp\252\002\033Xray.Transport.Internet.Udp'
- _CONFIG._serialized_start=68
- _CONFIG._serialized_end=76
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proto/transport/internet/websocket/config_grpc.py b/xray_api/proto/transport/internet/websocket/config_grpc.py
@@ -1,3 +0,0 @@
-# Generated by the Protocol Buffers compiler. DO NOT EDIT!
-# source: transport/internet/websocket/config.proto
-# plugin: grpclib.plugin.main
diff --git a/xray_api/proto/transport/internet/websocket/config_pb2.py b/xray_api/proto/transport/internet/websocket/config_pb2.py
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: transport/internet/websocket/config.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)transport/internet/websocket/config.proto\x12!xray.transport.internet.websocket\"$\n\x06Header\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\x82\x01\n\x06\x43onfig\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\x39\n\x06header\x18\x03 \x03(\x0b\x32).xray.transport.internet.websocket.Header\x12\x1d\n\x15\x61\x63\x63\x65pt_proxy_protocol\x18\x04 \x01(\x08\x12\n\n\x02\x65\x64\x18\x05 \x01(\rJ\x04\x08\x01\x10\x02\x42\x85\x01\n%com.xray.transport.internet.websocketP\x01Z6github.com/xtls/xray-core/transport/internet/websocket\xaa\x02!Xray.Transport.Internet.Websocketb\x06proto3')
-
-
-
-_HEADER = DESCRIPTOR.message_types_by_name['Header']
-_CONFIG = DESCRIPTOR.message_types_by_name['Config']
-Header = _reflection.GeneratedProtocolMessageType('Header', (_message.Message,), {
- 'DESCRIPTOR' : _HEADER,
- '__module__' : 'transport.internet.websocket.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.websocket.Header)
- })
-_sym_db.RegisterMessage(Header)
-
-Config = _reflection.GeneratedProtocolMessageType('Config', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIG,
- '__module__' : 'transport.internet.websocket.config_pb2'
- # @@protoc_insertion_point(class_scope:xray.xray_api.proto.transport.internet.websocket.Config)
- })
-_sym_db.RegisterMessage(Config)
-
-if _descriptor._USE_C_DESCRIPTORS == False:
-
- DESCRIPTOR._options = None
- DESCRIPTOR._serialized_options = b'\n%com.xray.transport.internet.websocketP\001Z6github.com/xtls/xray-core/transport/internet/websocket\252\002!Xray.Transport.Internet.Websocket'
- _HEADER._serialized_start=80
- _HEADER._serialized_end=116
- _CONFIG._serialized_start=119
- _CONFIG._serialized_end=249
-# @@protoc_insertion_point(module_scope)
diff --git a/xray_api/proxyman.py b/xray_api/proxyman.py
@@ -1,91 +0,0 @@
-import grpclib
-
-from .base import XRayBase
-from .exceptions import RelatedError
-from .proto.app.proxyman.command import command_pb2, command_grpc
-from .proto.common.protocol import user_pb2
-from .types.account import Account
-from .types.message import Message, TypedMessage
-
-#try:
-# from .proto.core import config_pb2 as core_config_pb2
-#except ModuleNotFoundError:
-# from .proto import config_pb2 as core_config_pb2
-
-
-class Proxyman(XRayBase):
- async def alter_inbound(self, tag: str, operation: TypedMessage) -> bool:
- self.create_channel()
- stub = command_grpc.HandlerServiceStub(self._channel)
- try:
- await stub.AlterInbound(command_pb2.AlterInboundRequest(tag=tag, operation=operation))
- return True
-
- except grpclib.exceptions.GRPCError as e:
- raise RelatedError(e)
-
- async def alter_outbound(self, tag: str, operation: TypedMessage) -> bool:
- self.create_channel()
- stub = command_grpc.HandlerServiceStub(self._channel)
- try:
- await stub.AlterInbound(command_pb2.AlterOutboundRequest(tag=tag, operation=operation))
- return True
-
- except grpclib.exceptions.GRPCError as e:
- raise RelatedError(e)
-
- async def add_inbound_user(self, tag: str, user: Account) -> bool:
- return await self.alter_inbound(
- tag=tag,
- operation=Message(
- command_pb2.AddUserOperation(
- user=user_pb2.User(
- level=user.level,
- email=user.email,
- account=user.message
- )
- )
- ))
-
- async def remove_inbound_user(self, tag: str, email: str) -> bool:
- return await self.alter_inbound(
- tag=tag,
- operation=Message(
- command_pb2.RemoveUserOperation(
- email=email
- )
- ))
-
- async def add_outbound_user(self, tag: str, user: Account) -> bool:
- return await self.alter_outbound(
- tag=tag,
- operation=Message(
- command_pb2.AddUserOperation(
- user=user_pb2.User(
- level=user.level,
- email=user.email,
- account=user.message
- )
- )
- ))
-
- async def remove_outbound_user(self, tag: str, email: str) -> bool:
- return await self.alter_outbound(
- tag=tag,
- operation=Message(
- command_pb2.RemoveUserOperation(
- email=email
- )
- ))
-
- async def add_inbound(self):
- raise NotImplementedError
-
- async def remove_inbound(self):
- raise NotImplementedError
-
- async def add_outbound(self):
- raise NotImplementedError
-
- async def remove_outbound(self):
- raise NotImplementedError
diff --git a/xray_api/stats.py b/xray_api/stats.py
@@ -1,126 +0,0 @@
-import typing
-from dataclasses import dataclass
-
-import grpclib
-
-from .base import XRayBase
-from .exceptions import RelatedError
-from .proto.app.stats.command import command_pb2, command_grpc
-
-
-@dataclass
-class SysStatsResponse:
- num_goroutine: int
- num_gc: int
- alloc: int
- total_alloc: int
- sys: int
- mallocs: int
- frees: int
- live_objects: int
- pause_total_ns: int
- uptime: int
-
-
-@dataclass
-class StatResponse:
- name: str
- type: str
- link: str
- value: int
-
-
-@dataclass
-class UserStatsResponse:
- email: str
- uplink: int
- downlink: int
-
-
-@dataclass
-class InboundStatsResponse:
- tag: str
- uplink: int
- downlink: int
-
-
-@dataclass
-class OutboundStatsResponse:
- tag: str
- uplink: int
- downlink: int
-
-
-class Stats(XRayBase):
- async def get_sys_stats(self) -> SysStatsResponse:
- self.create_channel()
- try:
- stub = command_grpc.StatsServiceStub(self._channel)
- r = await stub.GetSysStats(command_pb2.SysStatsRequest())
-
- except grpclib.exceptions.GRPCError as e:
- raise RelatedError(e)
-
- return SysStatsResponse(
- num_goroutine=r.NumGoroutine,
- num_gc=r.NumGC,
- alloc=r.Alloc,
- total_alloc=r.TotalAlloc,
- sys=r.Sys,
- mallocs=r.Mallocs,
- frees=r.Frees,
- live_objects=r.LiveObjects,
- pause_total_ns=r.PauseTotalNs,
- uptime=r.Uptime
- )
-
- async def query_stats(self, pattern: str, reset: bool = False) -> typing.Iterable[StatResponse]:
- self.create_channel()
- try:
- stub = command_grpc.StatsServiceStub(self._channel)
- r = await stub.QueryStats(command_pb2.QueryStatsRequest(pattern=pattern, reset=reset))
-
- except grpclib.exceptions.GRPCError as e:
- raise RelatedError(e)
- results = []
- for stat in r.stat:
- typ, name, _, link = stat.name.split('>>>')
- results.append(StatResponse(name, typ, link, stat.value))
- return results
-
- async def get_users_stats(self, reset: bool = False) -> typing.Iterable[StatResponse]:
- return await self.query_stats("user>>>", reset=reset)
-
- async def get_inbounds_stats(self, reset: bool = False) -> typing.Iterable[StatResponse]:
- return await self.query_stats("inbound>>>", reset=reset)
-
- async def get_outbounds_stats(self, reset: bool = False) -> typing.Iterable[StatResponse]:
- return await self.query_stats("outbound>>>", reset=reset)
-
- async def get_user_stats(self, email: str, reset: bool = False) -> typing.Iterable[StatResponse]:
- uplink, downlink = 0, 0
- for stat in await self.query_stats(f"user>>>{email}>>>", reset=reset):
- if stat.link == 'uplink':
- uplink = stat.value
- if stat.link == 'downlink':
- downlink = stat.value
-
- return UserStatsResponse(email=email, uplink=uplink, downlink=downlink)
-
- async def get_inbound_stats(self, tag: str, reset: bool = False) -> typing.Iterable[StatResponse]:
- uplink, downlink = 0, 0
- for stat in await self.query_stats(f"inbound>>>{tag}>>>", reset=reset):
- if stat.link == 'uplink':
- uplink = stat.value
- if stat.link == 'downlink':
- downlink = stat.value
- return InboundStatsResponse(tag=tag, uplink=uplink, downlink=downlink)
-
- async def get_outbound_stats(self, tag: str, reset: bool = False) -> typing.Iterable[StatResponse]:
- uplink, downlink = 0, 0
- for stat in await self.query_stats(f"outbound>>>{tag}>>>", reset=reset):
- if stat.link == 'uplink':
- uplink = stat.value
- if stat.link == 'downlink':
- downlink = stat.value
- return OutboundStatsResponse(tag=tag, uplink=uplink, downlink=downlink)
diff --git a/xray_api/types/__init__.py b/xray_api/types/__init__.py
@@ -1,3 +0,0 @@
-from .account import (Account, ShadowsocksAccount, TrojanAccount, VLESSAccount,
- VMessAccount)
-from .message import Message, TypedMessage
diff --git a/xray_api/types/account.py b/xray_api/types/account.py
@@ -1,76 +0,0 @@
-from abc import ABC, abstractproperty
-from enum import Enum
-from uuid import UUID
-
-from pydantic import BaseModel
-
-from ..proto.common.serial.typed_message_pb2 import TypedMessage
-from ..proto.proxy.shadowsocks.config_pb2 import \
- Account as ShadowsocksAccountPb2
-#from ..proto.proxy.shadowsocks.config_pb2 import \
-# CipherType as ShadowsocksCiphers
-from ..proto.proxy.trojan.config_pb2 import Account as TrojanAccountPb2
-from ..proto.proxy.vless.account_pb2 import Account as VLESSAccountPb2
-from ..proto.proxy.vmess.account_pb2 import Account as VMessAccountPb2
-from .message import Message
-
-
-class Account(BaseModel, ABC):
- email: str
- level: int = 0
-
- @abstractproperty
- def message(self) -> TypedMessage:
- pass
-
- def __repr__(self) -> str:
- return f"<{self.__class__.__name__} {self.email}>"
-
-
-class VMessAccount(Account):
- id: UUID
-
- @property
- def message(self):
- return Message(VMessAccountPb2(id=str(self.id)))
-
-
-class XTLSFlows(Enum):
- NONE = ''
- VISION = 'xtls-rprx-vision'
-
-
-class VLESSAccount(Account):
- id: UUID
- flow: XTLSFlows = XTLSFlows.NONE
-
- @property
- def message(self):
- return Message(VLESSAccountPb2(id=str(self.id), flow=self.flow.value))
-
-
-class TrojanAccount(Account):
- password: str
-
- @property
- def message(self):
- return Message(TrojanAccountPb2(password=self.password))
-
-
-class ShadowsocksMethods(Enum):
- AES_128_GCM = 'aes-128-gcm'
- AES_256_GCM = 'aes-256-gcm'
- CHACHA20_POLY1305 = 'chacha20-ietf-poly1305'
-
-
-class ShadowsocksAccount(Account):
- password: str
- method: ShadowsocksMethods = ShadowsocksMethods.CHACHA20_POLY1305
-
- @property
- def cipher_type(self):
- return self.method.name
-
- @property
- def message(self):
- return Message(ShadowsocksAccountPb2(password=self.password, cipher_type=self.cipher_type))
diff --git a/xray_api/types/message.py b/xray_api/types/message.py
@@ -1,9 +0,0 @@
-from ..proto.common.serial.typed_message_pb2 import TypedMessage
-
-
-class Message:
- def __new__(cls, message) -> TypedMessage:
- return TypedMessage(
- type=message.DESCRIPTOR.full_name,
- value=message.SerializeToString()
- )