mirror of
https://github.com/snltty/linker.git
synced 2025-09-26 21:15:57 +08:00
185
This commit is contained in:
17
src/linker.doc.web/docs/4、通信功能/4.1、虚拟网卡/1.2、点对网动态路由.md
Normal file
17
src/linker.doc.web/docs/4、通信功能/4.1、虚拟网卡/1.2、点对网动态路由.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# 1.2、点对网动态路由
|
||||
|
||||
:::tip[动态路由]
|
||||
|
||||
1. 默认情况下,在B上配置一个局域网IP,这条信息被A获取,A上给系统添加一条路由,且在linker程序内标记,这条路由的数据包要发送给B,然后A上就可以访问了
|
||||
2. 也有特殊情况,你想手动在A上添加路由,这些路由是动态的,你有别的系统去管理它们,这时候在linker没有标记,虽然有路由,但linker不知道要发给B还是C
|
||||
3. 那就需要以下操作,往`configs/ip-list.lin`文件内写入标记记录,格式是`路由ip,掩码长度,目标虚拟ip`,比如`192.168.188.0,24,10.18.18.2`,每行一条记录
|
||||
```
|
||||
192.168.188.0,24,10.18.18.2
|
||||
192.168.189.0,24,10.18.18.3
|
||||
```
|
||||
|
||||
:::
|
@@ -2,7 +2,7 @@
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# 1.2、网对网
|
||||
# 1.3、网对网
|
||||
|
||||
:::tip[在网关]
|
||||
|
@@ -49,7 +49,7 @@ namespace linker.messenger.updater
|
||||
LoggerHelper.Instance.Error(ex);
|
||||
updateInfo.Status = status;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 下载更新
|
||||
@@ -68,7 +68,7 @@ namespace linker.messenger.updater
|
||||
updateInfo.Current = 0;
|
||||
updateInfo.Length = 0;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(url) )
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
{
|
||||
updateInfo.Status = status;
|
||||
return;
|
||||
@@ -87,9 +87,22 @@ namespace linker.messenger.updater
|
||||
using HttpResponseMessage response = await httpClient.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
updateInfo.Length = response.Content.Headers.ContentLength ?? 0;
|
||||
|
||||
try
|
||||
{
|
||||
DriveInfo drive = new DriveInfo(Path.GetPathRoot(savePath));
|
||||
if (drive.AvailableFreeSpace < updateInfo.Length)
|
||||
{
|
||||
LoggerHelper.Instance.Error($"file size {updateInfo.Length}byte,device free space {drive.AvailableFreeSpace} byte");
|
||||
updateInfo.Status = status;
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
using Stream contentStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
||||
|
||||
|
||||
using FileStream fileStream = new FileStream(savePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
||||
byte[] buffer = new byte[4096];
|
||||
int readBytes = 0;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
v1.8.5
|
||||
2025-06-23 15:14:21
|
||||
2025-06-23 16:45:22
|
||||
1. 一些累计更新
|
||||
2. 备用信标服务器
|
||||
3. 设置默认中继节点
|
||||
|
Reference in New Issue
Block a user