Skip to content

Commit 79ac4ad

Browse files
authored
fix(ModNet):忘记这个文件了
1 parent 02fd463 commit 79ac4ad

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Plain Craft Launcher 2/Modules/Base/ModNet.vb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ Public Module ModNet
55

66
Private Property _Proxy As WebProxy
77
''' <summary>
8-
''' 获取 Proxy 代理
8+
''' 确定是否使用代理
99
''' </summary>
1010
''' <returns>返回 WebProxy 或者 Nothing</returns>
1111
Public Function GetProxy()
1212
Dim proxy As String = Setup.Get("SystemHttpProxy")
13-
If _Proxy IsNot Nothing AndAlso _Proxy.Address.AbsoluteUri = proxy Then
13+
If _Proxy IsNot Nothing AndAlso Setup.Get("SystemUseDefaultProxy") Then
1414
Log("[Net] 当前代理状态:跟随系统代理设置")
1515
Return _Proxy
1616
End If
17-
If Not String.IsNullOrWhiteSpace(proxy) Then
17+
If Not String.IsNullOrWhiteSpace(proxy) AndAlso Not Setup.Get("SystemUseDefaultProxy") Then
1818
_Proxy = New WebProxy(proxy, True)
1919
Log("[Net] 当前代理状态:自定义")
2020
Dim ProxyUri As New Uri(_Proxy.ToString)
2121
Try
22-
If ProxyUri.IsLoopBack OrElse
22+
If ProxyUri.IsLoopback OrElse
2323
ProxyUri.Host.StartsWithF("192.168.") OrElse
2424
ProxyUri.Host.StartsWithF("10.") OrElse
25-
ProxyUri.Host.StartswithF("fe80") OrElse
25+
ProxyUri.Host.StartsWithF("fe80") OrElse
2626
(ProxyUri.Host.Split(".")(1) > 16 AndAlso ProxyUri.Host.Split(".")(1) < 31 AndAlso ProxyUri.Host.StartsWithF("172.")) Then Log($"[Net] 使用 {_Proxy} 作为网络代理")
27-
'视作非本地地址
27+
'视作非本地地址
2828
Catch
2929
End Try
3030
Return _Proxy

0 commit comments

Comments
 (0)