Skip to content

Commit d333fa0

Browse files
committed
fix(subscription): handle None case in _get_hysteria_data_from_finalmask and update port selection in XrayConfiguration
1 parent 082b286 commit d333fa0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/subscription/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ def vless_route(uuid: str, route: str) -> str:
173173
parts[2] = route
174174
return "-".join(parts)
175175

176-
def _get_hysteria_data_from_finalmask(self, finalmask: dict) -> tuple[Any | Literal[""], Any | dict]:
176+
def _get_hysteria_data_from_finalmask(self, finalmask: dict | None) -> tuple[Any | Literal[""], Any | dict]:
177177
"""Extract Hysteria obfuscation password and QUIC parameters from finalmask"""
178178

179+
if finalmask is None:
180+
finalmask = {}
179181
obfs_password = ""
180182
quic_params: dict = finalmask.get("quicParams", {})
181183
if udp := finalmask.get("udp"):

app/subscription/xray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,8 @@ def _build_outbound(
569569
"tag": "proxy",
570570
"settings": {
571571
"version": 2,
572-
"address": inbound.address,
573-
"port": inbound.port,
572+
"address": address,
573+
"port": self._select_port(inbound.port),
574574
},
575575
}
576576

0 commit comments

Comments
 (0)