fix: SOCKS5 隧道修复 - 子线程事件循环兼容性

1. 去掉 asyncio.wait_for 包装 open_connection,改用直接调用
2. ConnectionHandler 增加 flask_app 参数,数据库操作使用 app context
3. InstanceManager 传递 flask_app 到 Socks5Server
4. 修复 _reply 中 writer.write 不需要 await 的问题

验证:
- 直连测试: HTTP/1.1 200 OK (ifconfig.me)
- 端口监听: 10800 正常工作
This commit is contained in:
Your Name
2026-07-16 19:00:53 +08:00
parent 4fbb63e0b9
commit 5ab5366534
3 changed files with 41 additions and 36 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ def create_app():
app.user_service = user_service
# 实例管理器
instance_manager = InstanceManager(user_service)
instance_manager = InstanceManager(user_service, flask_app=app)
app.instance_manager = instance_manager
# 备份目录