xiaoyaocz / AllLive

获取多个直播平台的信息和弹幕
MIT License
323 stars 21 forks source link

在启用Clash的TUN模式时,即使有网络也无法连接 #37

Open Tug9559 opened 1 year ago

Tug9559 commented 1 year ago

在Clash中启用TUN模式且配置为fake-ip而非系统代理时,即使网络连接正常,程序仍然会报错,由于AllLive在代码中忽略了记录网络请求的错误,本人不方便搭建调试环境,考虑到情况的类似性,使用BiliLite的日志举例:

2023-05-12 00:19:10.3373|INFO|2|StackTrace.LogRequest|网络请求: [GET]https://app.bilibili.com/x/v2/feed/index?...
2023-05-12 00:19:10.4384|ERROR|2|StackTrace.Send|GET请求失败https://app.bilibili.com/x/v2/feed/index?... Call failed. An error occurred while sending the request: GET https://app.bilibili.com/x/v2/feed/index?...  at Flurl.Http.FlurlRequest.<HandleExceptionAsync>d__35.MoveNext() + 0x21f
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Flurl.Http.FlurlRequest.<SendAsync>d__29.MoveNext() + 0x551
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at Flurl.Http.FlurlRequest.<SendAsync>d__29.MoveNext() + 0x8e4
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at BiliLite.Models.Requests.BiliRequest.<Send>d__13.MoveNext() + 0x1b7

初步判断和Windows的网络探针有关,https://github.com/Fndroid/clash_for_windows_pkg/issues/3834#issuecomment-1544326291