Files
Hermes-1 ed52257dbe refactor: split monolith into typed modules with retry logic
- models.py: ProxyInfo and DNSServerConfig dataclasses with type hints
- fetcher.py: subscription fetcher with exponential backoff retries (3 attempts) plus VLESS URL parser
- config_builder.py: sing-box config builder decomposed into focused helpers
- main.py: orchestrator with setup_logging(), print_banner(), pick_node()
2026-07-09 08:14:23 +00:00

34 lines
688 B
Python

#!/usr/bin/env python3
"""Data models for Sub2SOCKS."""
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
@dataclass
class ProxyInfo:
"""Parsed VLESS proxy configuration."""
uuid: str
server: str
port: int
security: str = "tls"
type: str = "tcp"
sni: str = ""
alpn: str = ""
pbk: str = ""
sid: str = ""
spx: str = ""
path: str = "/"
serviceName: str = ""
host: str = ""
flow: str = ""
@dataclass
class DNSServerConfig:
"""Sing-box DNS server configuration."""
server_type: str # udp, tls, https
server: str
server_port: int = 53
tls_config: Optional[Dict[str, Any]] = None