sfun commited on
Commit
c35b915
1 Parent(s): 7ed281d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -103,8 +103,6 @@ async def extract_and_transform_proxies(input_text):
103
  parts.append(f"encrypt-method={proxy['cipher'].strip()}")
104
  if 'password' in proxy:
105
  parts.append(f"password={proxy['password'].strip()}")
106
- # 为 ss 类型默认添加 udp-relay=true
107
- parts.append("udp-relay=true")
108
  elif proxy_type in ['trojan', 'hysteria2']:
109
  if 'password' in proxy:
110
  parts.append(f"password={proxy['password'].strip()}")
@@ -128,8 +126,11 @@ async def extract_and_transform_proxies(input_text):
128
  if 'tcp_fast_open' in proxy:
129
  parts.append(f"tfo={str(proxy['tcp_fast_open']).lower()}")
130
 
 
131
  if 'udp' in proxy:
132
  parts.append(f"udp-relay={'true' if proxy['udp'] in [True, 'true', 'True'] else 'false'}")
 
 
133
 
134
  transformed_proxies.append(", ".join(parts))
135
 
 
103
  parts.append(f"encrypt-method={proxy['cipher'].strip()}")
104
  if 'password' in proxy:
105
  parts.append(f"password={proxy['password'].strip()}")
 
 
106
  elif proxy_type in ['trojan', 'hysteria2']:
107
  if 'password' in proxy:
108
  parts.append(f"password={proxy['password'].strip()}")
 
126
  if 'tcp_fast_open' in proxy:
127
  parts.append(f"tfo={str(proxy['tcp_fast_open']).lower()}")
128
 
129
+ # 统一处理 udp-relay,避免重复
130
  if 'udp' in proxy:
131
  parts.append(f"udp-relay={'true' if proxy['udp'] in [True, 'true', 'True'] else 'false'}")
132
+ elif proxy_type == 'ss':
133
+ parts.append("udp-relay=true")
134
 
135
  transformed_proxies.append(", ".join(parts))
136