fix(normalsub): conditionally generate sing-box obfs config
This commit is contained in:
@ -308,15 +308,11 @@ class SingboxConfigGenerator:
|
|||||||
print(f"Error during Singbox config generation from URI: {e}, URI: {uri}")
|
print(f"Error during Singbox config generation from URI: {e}, URI: {uri}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
outbound_config = {
|
||||||
"type": "hysteria2",
|
"type": "hysteria2",
|
||||||
"tag": unquote(parsed_url.fragment),
|
"tag": unquote(parsed_url.fragment),
|
||||||
"server": server,
|
"server": server,
|
||||||
"server_port": server_port,
|
"server_port": server_port,
|
||||||
"obfs": {
|
|
||||||
"type": "salamander",
|
|
||||||
"password": obfs_password
|
|
||||||
},
|
|
||||||
"password": final_password,
|
"password": final_password,
|
||||||
"tls": {
|
"tls": {
|
||||||
"enabled": True,
|
"enabled": True,
|
||||||
@ -325,6 +321,14 @@ class SingboxConfigGenerator:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if obfs_password:
|
||||||
|
outbound_config["obfs"] = {
|
||||||
|
"type": "salamander",
|
||||||
|
"password": obfs_password
|
||||||
|
}
|
||||||
|
|
||||||
|
return outbound_config
|
||||||
|
|
||||||
def combine_configs(self, all_uris: List[str], username: str, fragment: str) -> Optional[Dict[str, Any]]:
|
def combine_configs(self, all_uris: List[str], username: str, fragment: str) -> Optional[Dict[str, Any]]:
|
||||||
if not all_uris:
|
if not all_uris:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user