mirror of
https://github.com/snltty/linker.git
synced 2026-02-19 06:40:51 +08:00
一些修复
This commit is contained in:
2
.github/workflows/dotnet.yml
vendored
2
.github/workflows/dotnet.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
release_name: v1.9.9.${{ steps.date.outputs.today }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: "1. 一些累计更新,一些BUG修复\r\n2. 国家级别的连接限制\r\n3. 修复一些地方未能正确释放端口的问题\r\n4. 一些UI错位修复\r\n5. net10发布后在一些系统无法正常运行,先回退net8"
|
||||
body: "1. 一些累计更新,一些BUG修复\r\n2. 国家级别的连接限制\r\n3. 修复一些地方未能正确释放端口的问题\r\n4. 一些UI错位修复\r\n5. net10发布后在一些系统无法正常运行,先回退net8\r\n6. 修复协议设置bug,增加隧道协议选项,增加wol的ip项"
|
||||
- name: setup node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
v1.9.9
|
||||
2026-01-21 15:05:06
|
||||
2026-01-24 17:37:19
|
||||
1. 一些累计更新,一些BUG修复
|
||||
2. 国家级别的连接限制
|
||||
3. 修复一些地方未能正确释放端口的问题
|
||||
4. 一些UI错位修复
|
||||
5. net10发布后在一些系统无法正常运行,先回退net8
|
||||
5. net10发布后在一些系统无法正常运行,先回退net8
|
||||
6. 修复协议设置bug,增加隧道协议选项,增加wol的ip项
|
||||
@@ -5,7 +5,22 @@ slug: /p2p/hole
|
||||
|
||||
# 3.0、打洞
|
||||
|
||||
## 1、支持msquic
|
||||
|
||||
|
||||
## 1、打洞协议调整
|
||||
|
||||
:::tip[说明]
|
||||
1. 从上往下按顺序尝试连接,且跳过禁用项,你可以随便调整
|
||||
2. 关于尝试IP,ipv6、ipv4、lan,如果你不想让它用某一项就取消勾选,lan是局域网ip的意思
|
||||
3. 关于与某客户端的独立配置,比如和某客户端只想中继,不想打洞等等,随便调整,连接时将优先使用独立配置
|
||||
4. `按喜好调整好即可,往后的所有通信都是自动的,无需其它操作`
|
||||
|
||||

|
||||

|
||||
:::
|
||||
|
||||
|
||||
## 2、支持msquic
|
||||
|
||||
:::tip[说明]
|
||||
|
||||
@@ -14,14 +29,3 @@ slug: /p2p/hole
|
||||
3. 在linux alpine,可以参照<a target="_blank" href="https://blog.snltty.com/2024/07/24/%e8%87%aa%e5%b7%b1%e7%bc%96%e8%af%91alpine%e4%b8%8b%e7%9a%84msquic/">编译alpine平台的msquic</a>自己编译msquic
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## 2、打洞协议调整
|
||||
|
||||
:::tip[说明]
|
||||
1. 按顺序打洞,你可以调整顺序,优先使用哪些打洞协议
|
||||
2. 如果你不想打洞,可以禁用所有打洞协议
|
||||
3. `按喜好调整好即可,往后的所有通信都是自动的,无需其它操作`
|
||||
|
||||

|
||||
:::
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 87 KiB |
BIN
src/linker.doc.web/docs/3、打洞和中继/img/p2p1.png
Normal file
BIN
src/linker.doc.web/docs/3、打洞和中继/img/p2p1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 254 KiB |
BIN
src/linker.doc.web/docs/3、打洞和中继/img/p2p2.png
Normal file
BIN
src/linker.doc.web/docs/3、打洞和中继/img/p2p2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 279 KiB |
@@ -169,14 +169,27 @@ namespace linker.messenger.serializer.memorypack
|
||||
[MemoryPackInclude]
|
||||
byte Order => tunnelTransportItemInfo.Order;
|
||||
|
||||
[MemoryPackInclude]
|
||||
Addrs Addr => tunnelTransportItemInfo.Addr;
|
||||
|
||||
|
||||
[MemoryPackConstructor]
|
||||
SerializableTunnelTransportItemInfo(string name, string label, string protocolType, bool disabled, bool reverse, bool ssl, byte buffersize, byte order)
|
||||
SerializableTunnelTransportItemInfo(string name, string label, string protocolType, bool disabled, bool reverse, bool ssl, byte buffersize, byte order, Addrs addr)
|
||||
{
|
||||
var tunnelTransportItemInfo = new TunnelTransportItemInfo { Name = name, Label = label, ProtocolType = protocolType, Disabled = disabled, Reverse = reverse, SSL = ssl, BufferSize = buffersize, Order = order };
|
||||
var tunnelTransportItemInfo = new TunnelTransportItemInfo
|
||||
{
|
||||
Name = name,
|
||||
Label = label,
|
||||
ProtocolType = protocolType,
|
||||
Disabled = disabled,
|
||||
Reverse = reverse,
|
||||
SSL = ssl,
|
||||
BufferSize = buffersize,
|
||||
Order = order,
|
||||
Addr = addr
|
||||
};
|
||||
this.tunnelTransportItemInfo = tunnelTransportItemInfo;
|
||||
}
|
||||
|
||||
public SerializableTunnelTransportItemInfo(TunnelTransportItemInfo tunnelTransportItemInfo)
|
||||
{
|
||||
this.tunnelTransportItemInfo = tunnelTransportItemInfo;
|
||||
@@ -204,8 +217,18 @@ namespace linker.messenger.serializer.memorypack
|
||||
return;
|
||||
}
|
||||
|
||||
var wrapped = reader.ReadPackable<SerializableTunnelTransportItemInfo>();
|
||||
value = wrapped.tunnelTransportItemInfo;
|
||||
value = new TunnelTransportItemInfo();
|
||||
reader.TryReadObjectHeader(out byte count);
|
||||
value.Name = reader.ReadValue<string>();
|
||||
value.Label = reader.ReadValue<string>();
|
||||
value.ProtocolType = reader.ReadValue<string>();
|
||||
value.Disabled = reader.ReadValue<bool>();
|
||||
value.Reverse = reader.ReadValue<bool>();
|
||||
value.SSL = reader.ReadValue<bool>();
|
||||
value.BufferSize = reader.ReadValue<byte>();
|
||||
value.Order = reader.ReadValue<byte>();
|
||||
if (count > 8)
|
||||
value.Addr = reader.ReadValue<Addrs>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,8 @@ namespace linker.messenger.store.file.tunnel
|
||||
DisableReverse = c.DisableReverse,
|
||||
SSL = c.SSL,
|
||||
DisableSSL = c.DisableSSL,
|
||||
Order = c.Order
|
||||
Order = c.Order,
|
||||
Addr = c.Addr
|
||||
}));
|
||||
}
|
||||
//有已移除的协议
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace linker.messenger.tunnel
|
||||
{
|
||||
TunnelTransportItemSetInfo info = serializer.Deserialize<TunnelTransportItemSetInfo>(connection.ReceiveRequestWrap.Payload.Span);
|
||||
await tunnelMessengerAdapter.SetTunnelTransports(info.MachineId, info.Data);
|
||||
connection.Write(Helper.TrueArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,13 @@ namespace linker.messenger.wakeup
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(info.Content))
|
||||
{
|
||||
info.Content = "255.255.255.255";
|
||||
}
|
||||
|
||||
//MAC地址格式:XX:XX:XX:XX:XX:XX 或者 XX-XX-XX-XX-XX-XX 或者 XXXXXXXXXXXX 转字节数组
|
||||
ReadOnlySpan<char> macAddress = info.Value.AsSpan();
|
||||
ReadOnlySpan<char> macAddress = info.Value.Trim().AsSpan();
|
||||
Span<byte> macBytes = stackalloc byte[6];
|
||||
int byteIndex = 0;
|
||||
for (int i = 0; i < macAddress.Length && byteIndex < 6; i++)
|
||||
@@ -134,7 +139,7 @@ namespace linker.messenger.wakeup
|
||||
using UdpClient client = new UdpClient();
|
||||
client.EnableBroadcast = true;
|
||||
client.Client.WindowsUdpBug();
|
||||
client.Send(magicPacket, new IPEndPoint(IPAddress.Parse("255.255.255.255"), 9));
|
||||
client.Send(magicPacket, new IPEndPoint(IPAddress.Parse(info.Content.Trim()), 9));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -159,9 +164,9 @@ namespace linker.messenger.wakeup
|
||||
{
|
||||
try
|
||||
{
|
||||
byte road = byte.Parse(info.Content);
|
||||
byte road = byte.Parse(info.Content.Trim());
|
||||
|
||||
SerialDevice device = HidSharp.DeviceList.Local.GetSerialDevices().FirstOrDefault(c => c.DevicePath == info.Value);
|
||||
SerialDevice device = HidSharp.DeviceList.Local.GetSerialDevices().FirstOrDefault(c => c.DevicePath == info.Value.Trim());
|
||||
using SerialStream stream = device.Open();
|
||||
|
||||
stream.Write([0xA0, road, 0x01, (byte)(0xA0 + road + 0x01)]);
|
||||
@@ -186,8 +191,8 @@ namespace linker.messenger.wakeup
|
||||
{
|
||||
try
|
||||
{
|
||||
byte road = byte.Parse(info.Content);
|
||||
HidDevice device = HidSharp.DeviceList.Local.GetHidDevices().FirstOrDefault(c => c.DevicePath == info.Value);
|
||||
byte road = byte.Parse(info.Content.Trim());
|
||||
HidDevice device = HidSharp.DeviceList.Local.GetHidDevices().FirstOrDefault(c => c.DevicePath == info.Value.Trim());
|
||||
using HidStream stream = device.Open();
|
||||
|
||||
stream.Write([0x00, 0xA0, road, 0x01, (byte)(0xA0 + road + 0x01)]);
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace linker.tunnel
|
||||
FlowId = Interlocked.Increment(ref flowid),
|
||||
};
|
||||
OnConnecting(tunnelTransportInfo);
|
||||
ParseRemoteEndPoint(tunnelTransportInfo);
|
||||
ParseRemoteEndPoint(tunnelTransportInfo, transportItem.Addr);
|
||||
ITunnelConnection connection = await transport.ConnectAsync(tunnelTransportInfo).ConfigureAwait(false);
|
||||
if (connection != null)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ namespace linker.tunnel
|
||||
{
|
||||
transport.SetSSL(tunnelMessengerAdapter.Certificate);
|
||||
OnConnectBegin(tunnelTransportInfo);
|
||||
ParseRemoteEndPoint(tunnelTransportInfo);
|
||||
ParseRemoteEndPoint(tunnelTransportInfo, item.Addr);
|
||||
_ = transport.OnBegin(tunnelTransportInfo).ContinueWith((result) =>
|
||||
{
|
||||
operating.StopOperation(BuildKey(tunnelTransportInfo.Remote.MachineId, tunnelTransportInfo.TransactionId));
|
||||
@@ -441,7 +441,7 @@ namespace linker.tunnel
|
||||
LoggerHelper.Instance.Error($"tunnel connect {tunnelTransportInfo.Remote.MachineId} fail");
|
||||
}
|
||||
|
||||
private void ParseRemoteEndPoint(TunnelTransportInfo tunnelTransportInfo)
|
||||
private void ParseRemoteEndPoint(TunnelTransportInfo tunnelTransportInfo, Addrs addr)
|
||||
{
|
||||
if (tunnelTransportInfo.Local == null || tunnelTransportInfo.Remote == null) return;
|
||||
|
||||
@@ -490,6 +490,20 @@ namespace linker.tunnel
|
||||
.Where(c => c.Address.Equals(IPAddress.Any) == false && c.Port > 0)
|
||||
.ToList();
|
||||
|
||||
|
||||
if (addr.HasFlag(Addrs.Ipv6) == false)
|
||||
{
|
||||
eps = eps.Where(c => c.AddressFamily != AddressFamily.InterNetworkV6).ToList();
|
||||
}
|
||||
if (addr.HasFlag(Addrs.Ipv4) == false)
|
||||
{
|
||||
eps = eps.Where(c => c.AddressFamily != AddressFamily.InterNetwork).ToList();
|
||||
}
|
||||
if (addr.HasFlag(Addrs.Lan) == false)
|
||||
{
|
||||
eps = eps.Where(c => tunnelTransportInfo.Remote.LocalIps.Contains(c.Address) == false).ToList();
|
||||
}
|
||||
|
||||
tunnelTransportInfo.RemoteEndPoints = eps;
|
||||
}
|
||||
private static string BuildKey(string remoteMachineId, string transactionId)
|
||||
|
||||
@@ -161,8 +161,18 @@ namespace linker.tunnel.transport
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public byte Order { get; set; }
|
||||
|
||||
public Addrs Addr { get; set; } = Addrs.Ipv6 | Addrs.Ipv4 | Addrs.Lan;
|
||||
}
|
||||
|
||||
public enum Addrs : byte
|
||||
{
|
||||
Ipv6 = 1,
|
||||
Ipv4 = 2,
|
||||
Lan = 4,
|
||||
}
|
||||
|
||||
|
||||
public sealed partial class TunnelTransportInfo
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -178,6 +178,7 @@ export default {
|
||||
|
||||
'status.tunnelName': 'Name',
|
||||
'status.tunnelLabel': 'Label',
|
||||
'status.tunnelAddr': 'Addrs',
|
||||
'status.tunnelProtocol': 'Proto',
|
||||
'status.tunnelBuffer': 'Buffer',
|
||||
'status.tunnelReverse': 'Reverse',
|
||||
@@ -421,6 +422,7 @@ export default {
|
||||
'wakeup.value':'Value',
|
||||
'wakeup.road':'Road',
|
||||
'wakeup.valueMac':'MAC Addr',
|
||||
'wakeup.addr':'ip',
|
||||
'wakeup.valueCom':'COM',
|
||||
'wakeup.valueComText':'LCUS COM,Baud Rate 9600,Data bits 8,Parity None,StopBits 1,',
|
||||
'wakeup.valueHid':'HID',
|
||||
|
||||
@@ -273,6 +273,7 @@ export default {
|
||||
|
||||
'status.tunnelName': '名称',
|
||||
'status.tunnelLabel': '说明',
|
||||
'status.tunnelAddr': '尝试IP',
|
||||
'status.tunnelProtocol': '协议',
|
||||
'status.tunnelBuffer': '缓冲区',
|
||||
'status.tunnelReverse': '反向',
|
||||
@@ -517,6 +518,7 @@ export default {
|
||||
'wakeup.value':'值',
|
||||
'wakeup.road':'通道',
|
||||
'wakeup.valueMac':'MAC地址',
|
||||
'wakeup.addr':'ip',
|
||||
'wakeup.valueCom':'COM',
|
||||
'wakeup.valueComText':'LCUS COM,波特率9600,数据位长度8,奇偶校验无,停止位1,',
|
||||
'wakeup.valueHid':'HID',
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
<template>
|
||||
<el-table stripe :data="state.list" border size="small" width="100%" height="100%">
|
||||
<el-table-column prop="Name" :label="$t('status.tunnelName')" width="120"></el-table-column>
|
||||
<el-table-column prop="Label" :label="$t('status.tunnelLabel')"></el-table-column>
|
||||
<el-table-column prop="Name" :label="$t('status.tunnelName')" width="100"></el-table-column>
|
||||
<el-table-column prop="ProtocolType" :label="$t('status.tunnelProtocol')" width="60"></el-table-column>
|
||||
<el-table-column prop="BufferSize" :label="$t('status.tunnelBuffer')" width="100">
|
||||
<el-table-column prop="Label" :label="$t('status.tunnelLabel')" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="BufferSize" :label="$t('status.tunnelBuffer')" width="80">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.BufferSize" placeholder="Select" size="small" @change="handleSave">
|
||||
<el-option v-for="(item,index) in state.bufferSize" :key="index" :label="item" :value="index"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="Addr" :label="$t('status.tunnelAddr')" width="155">
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.Name != 'TcpRelay'">
|
||||
<el-checkbox-group size="small" v-model="scope.row._addr" @change="handleSave" >
|
||||
<el-checkbox-button :value="1" label="ipv6"/>
|
||||
<el-checkbox-button :value="2" label="ipv4"/>
|
||||
<el-checkbox-button :value="4" label="lan"/>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
--
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="Reverse" :label="$t('status.tunnelReverse')" width="64">
|
||||
<template #default="scope">
|
||||
@@ -65,7 +79,11 @@ export default {
|
||||
|
||||
const getData = ()=>{
|
||||
getTunnelTransports(state.machineid).then((res)=>{
|
||||
state.list = res.sort((a,b)=>a.Order - b.Order);
|
||||
const list = res.sort((a,b)=>a.Order - b.Order);
|
||||
list.forEach((item,index)=>{
|
||||
item._addr = [item.Addr & 1,item.Addr & 2,item.Addr & 4].filter(c=>c>0);
|
||||
});
|
||||
state.list = list;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -74,6 +92,10 @@ export default {
|
||||
}
|
||||
const handleSave = ()=>{
|
||||
state.list = state.list.slice().sort((a,b)=>a.Order - b.Order);
|
||||
state.list.forEach((item,index)=>{
|
||||
item.Addr = item._addr.reduce((a,b)=>a|b,0);
|
||||
});
|
||||
console.log(state.list);
|
||||
setTunnelTransports({
|
||||
machineid:state.machineid,
|
||||
data:state.list
|
||||
|
||||
@@ -27,7 +27,11 @@
|
||||
<el-col :span="12">
|
||||
<el-input v-trim v-model="state.ruleForm.Data.value1" />
|
||||
</el-col>
|
||||
<el-col :span="12"></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('wakeup.addr')" prop="addr">
|
||||
<el-input v-trim v-model="state.ruleForm.Data.addr" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -107,7 +111,8 @@ export default {
|
||||
value1:add.value.Data.Type == 1 ? add.value.Data.Value : '',
|
||||
value2:add.value.Data.Type == 2 ? add.value.Data.Value : '',
|
||||
value4:add.value.Data.Type == 4 ? add.value.Data.Value : '',
|
||||
road: add.value.Data.Content || '1'
|
||||
road: add.value.Data.Content || '1',
|
||||
addr: add.value.Data.Content || '255.255.255.255',
|
||||
}
|
||||
},
|
||||
rules:{
|
||||
@@ -178,7 +183,7 @@ export default {
|
||||
Value:state.ruleForm.Data[`value${state.ruleForm.Data.Type}`]|| '',
|
||||
Remark:state.ruleForm.Data.Remark || '',
|
||||
Content:state.ruleForm.Data.Type == 2 || state.ruleForm.Data.Type == 4
|
||||
? state.ruleForm.Data.road : ''
|
||||
? state.ruleForm.Data.road : state.ruleForm.Data.addr
|
||||
}
|
||||
};
|
||||
addWakeup(json).then(()=>{
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<div class="ellipsis" :title="scope.row.Value">{{ scope.row.Value }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Content" :label="$t('wakeup.value')"></el-table-column>
|
||||
<el-table-column prop="Remark" :label="$t('wakeup.remark')" width="100">
|
||||
<template v-slot="scope">
|
||||
<div class="ellipsis" :title="scope.row.Remark">{{ scope.row.Remark }}</div>
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
2. 国家级别的连接限制
|
||||
3. 修复一些地方未能正确释放端口的问题
|
||||
4. 一些UI错位修复
|
||||
5. net10发布后在一些系统无法正常运行,先回退net8</Description>
|
||||
5. net10发布后在一些系统无法正常运行,先回退net8
|
||||
6. 修复协议设置bug,增加隧道协议选项,增加wol的ip项</Description>
|
||||
<Copyright>snltty</Copyright>
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
|
||||
Reference in New Issue
Block a user