28 lines
677 B
Python
28 lines
677 B
Python
from core.models.BaseConnection import BaseConnection
|
|
from dataclasses import dataclass
|
|
from enum import Enum
|
|
from typing import Literal
|
|
|
|
class SystemConnectionTypes(str, Enum):
|
|
WIREGUARD = "wireguard"
|
|
HYSTERIA2 = "hysteria2"
|
|
VLESS = "vless"
|
|
|
|
@dataclass
|
|
class SystemConnection(BaseConnection):
|
|
code: SystemConnectionTypes
|
|
masked: Literal[False] = False
|
|
|
|
@staticmethod
|
|
def needs_proxy_configuration():
|
|
return False
|
|
|
|
# legacy:
|
|
# @dataclass
|
|
# class SystemConnection (BaseConnection):
|
|
|
|
|
|
# def __post_init__(self):
|
|
|
|
# if self.code not in ('vless', 'hysteria2', 'wireguard'):
|
|
# raise ValueError('Invalid connection code.')
|