mirror of
https://github.com/snltty/linker.git
synced 2025-12-18 17:36:45 +08:00
sync
This commit is contained in:
8
.github/workflows/docker.yml
vendored
8
.github/workflows/docker.yml
vendored
@@ -57,9 +57,9 @@ jobs:
|
||||
docker tag snltty/linker-musl-x64:latest snltty/linker-musl:amd64 && \
|
||||
docker push snltty/linker-musl:amd64 && \
|
||||
docker manifest create snltty/linker-musl:latest snltty/linker-musl:amd64 snltty/linker-musl:arm64 snltty/linker-musl:arm && \
|
||||
docker manifest create snltty/linker-musl:v1.5.1 snltty/linker-musl:amd64 snltty/linker-musl:arm64 snltty/linker-musl:arm && \
|
||||
docker manifest create snltty/linker-musl:v1.5.2 snltty/linker-musl:amd64 snltty/linker-musl:arm64 snltty/linker-musl:arm && \
|
||||
docker manifest push snltty/linker-musl:latest && \
|
||||
docker manifest push snltty/linker-musl:v1.5.1 && \
|
||||
docker manifest push snltty/linker-musl:v1.5.2 && \
|
||||
docker pull --platform linux/arm/v7 snltty/linker-debian-arm:latest && \
|
||||
docker tag snltty/linker-debian-arm:latest snltty/linker-debian:arm && \
|
||||
docker push snltty/linker-debian:arm && \
|
||||
@@ -70,6 +70,6 @@ jobs:
|
||||
docker tag snltty/linker-debian-x64:latest snltty/linker-debian:amd64 && \
|
||||
docker push snltty/linker-debian:amd64 && \
|
||||
docker manifest create snltty/linker-debian:latest snltty/linker-debian:amd64 snltty/linker-debian:arm64 snltty/linker-debian:arm && \
|
||||
docker manifest create snltty/linker-debian:v1.5.1 snltty/linker-debian:amd64 snltty/linker-debian:arm64 snltty/linker-debian:arm && \
|
||||
docker manifest create snltty/linker-debian:v1.5.2 snltty/linker-debian:amd64 snltty/linker-debian:arm64 snltty/linker-debian:arm && \
|
||||
docker manifest push snltty/linker-debian:latest && \
|
||||
docker manifest push snltty/linker-debian:v1.5.1
|
||||
docker manifest push snltty/linker-debian:v1.5.2
|
||||
30
.github/workflows/dotnet.yml
vendored
30
.github/workflows/dotnet.yml
vendored
@@ -33,11 +33,11 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
|
||||
with:
|
||||
tag_name: v1.5.1
|
||||
release_name: v1.5.1.${{ steps.date.outputs.today }}
|
||||
tag_name: v1.5.2
|
||||
release_name: v1.5.2.${{ steps.date.outputs.today }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: "1. 优化点对网和网对网的局域网IP,包括禁用IP,和冲突检测\r\n2. 一些UI优化\r\n3. 新增socks5代理\r\n4. 优化端口转发和内网穿透配置\r\n5. 优化网卡的一些东西\r\n6. 统一的去中心数据同步,减少bug"
|
||||
body: "1. 多中继节点服务器\r\n6. 测试中,不要更新,不要更新,不要更新"
|
||||
- name: upload-win-x86-oss
|
||||
id: upload-win-x86-oss
|
||||
uses: tvrcgo/oss-action@v0.1.1
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-win-x86.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-win-x86.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-win-x86.zip
|
||||
- name: upload-win-x86
|
||||
id: upload-win-x86
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-win-x64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-win-x64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-win-x64.zip
|
||||
- name: upload-win-x64
|
||||
id: upload-win-x64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-win-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-win-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-win-arm64.zip
|
||||
- name: upload-win-arm64
|
||||
id: upload-win-arm64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-linux-x64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-linux-x64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-linux-x64.zip
|
||||
- name: upload-linux-x64
|
||||
id: upload-linux-x64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -127,7 +127,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-linux-arm.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-linux-arm.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-linux-arm.zip
|
||||
- name: upload-linux-arm
|
||||
id: upload-linux-arm
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-linux-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-linux-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-linux-arm64.zip
|
||||
- name: upload-linux-arm64
|
||||
id: upload-linux-arm64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -167,7 +167,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-linux-musl-x64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-linux-musl-x64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-linux-musl-x64.zip
|
||||
- name: upload-linux-musl-x64
|
||||
id: upload-linux-musl-x64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -187,7 +187,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-linux-musl-arm.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-linux-musl-arm.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-linux-musl-arm.zip
|
||||
- name: upload-linux-musl-arm
|
||||
id: upload-linux-musl-arm
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -207,7 +207,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-linux-musl-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-linux-musl-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-linux-musl-arm64.zip
|
||||
- name: upload-linux-musl-arm64
|
||||
id: upload-linux-musl-arm64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -227,7 +227,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-osx-x64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-osx-x64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-osx-x64.zip
|
||||
- name: upload-osx-x64
|
||||
id: upload-osx-x64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -247,7 +247,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-osx-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-osx-arm64.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-osx-arm64.zip
|
||||
- name: upload-osx-arm64
|
||||
id: upload-osx-arm64
|
||||
uses: actions/upload-release-asset@master
|
||||
@@ -277,7 +277,7 @@ jobs:
|
||||
key-secret: ${{ secrets.ALIYUN_OSS_SECRET }}
|
||||
bucket: ide-qbcode
|
||||
asset-path: ./public/publish-zip/linker-windows-route.zip
|
||||
target-path: /downloads/linker/v1.5.1/linker-windows-route.zip
|
||||
target-path: /downloads/linker/v1.5.2/linker-windows-route.zip
|
||||
- name: upload-windows-route
|
||||
id: upload-windows-route
|
||||
uses: actions/upload-release-asset@master
|
||||
|
||||
6
.github/workflows/nuget.yml
vendored
6
.github/workflows/nuget.yml
vendored
@@ -38,6 +38,6 @@ jobs:
|
||||
|
||||
- name: Push
|
||||
run: |
|
||||
nuget push ./linker.tunnel/bin/release/linker.tunnel.1.5.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
nuget push ./linker.libs/bin/release/linker.libs.1.5.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
nuget push ./linker.tun/bin/release/linker.tun.1.5.1.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
nuget push ./linker.tunnel/bin/release/linker.tunnel.1.5.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
nuget push ./linker.libs/bin/release/linker.libs.1.5.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
nuget push ./linker.tun/bin/release/linker.tun.1.5.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<Copyright>snltty</Copyright>
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<Version>1.5.1</Version>
|
||||
<AssemblyVersion>1.5.1</AssemblyVersion>
|
||||
<FileVersion>1.5.1</FileVersion>
|
||||
<Version>1.5.2</Version>
|
||||
<AssemblyVersion>1.5.2</AssemblyVersion>
|
||||
<FileVersion>1.5.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>full</DebugType>
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<PackageReleaseNotes>linker tun</PackageReleaseNotes>
|
||||
<Version>1.5.1</Version>
|
||||
<AssemblyVersion>1.5.1</AssemblyVersion>
|
||||
<FileVersion>1.5.1</FileVersion>
|
||||
<Version>1.5.2</Version>
|
||||
<AssemblyVersion>1.5.2</AssemblyVersion>
|
||||
<FileVersion>1.5.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<PackageReleaseNotes>linker tunnel</PackageReleaseNotes>
|
||||
<Version>1.5.1</Version>
|
||||
<AssemblyVersion>1.5.1</AssemblyVersion>
|
||||
<FileVersion>1.5.1</FileVersion>
|
||||
<Version>1.5.2</Version>
|
||||
<AssemblyVersion>1.5.2</AssemblyVersion>
|
||||
<FileVersion>1.5.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -5,4 +5,7 @@ export const setRelayServers = (servers) => {
|
||||
}
|
||||
export const setRelaySubscribe = () => {
|
||||
return sendWebsocketMsg('relay/Subscribe');
|
||||
}
|
||||
export const relayConnect = (data) => {
|
||||
return sendWebsocketMsg('relay/Connect', data);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-model="state.show" append-to=".app-wrap" :title="`与[${state.machineName}]的链接`" top="1vh" width="780">
|
||||
<el-dialog v-model="state.show" append-to=".app-wrap" :title="`与[${state.machineName}]的链接`" top="1vh" width="780">
|
||||
<div>
|
||||
<el-table :data="state.data" size="small" border height="500">
|
||||
<el-table-column property="RemoteMachineId" label="目标/服务器">
|
||||
@@ -39,9 +39,7 @@
|
||||
<el-table-column property="relay" label="中继节点">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-select disabled :model-value="scope.row.NodeId" placeholder="中继节点" size="large">
|
||||
<el-option v-for="item in state.nodes" :key="item.Id" :label="item.Name" :value="item.Id"/>
|
||||
</el-select>
|
||||
<a href="javascript:;" class="a-line" @click="handleNode(scope.row)">{{ state.nodesDic[scope.row.NodeId] || '选择节点' }}</a>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -60,6 +58,39 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="state.showNodes" title="中继节点" width="600" top="2vh">
|
||||
<div>
|
||||
<el-table :data="state.nodes" size="small" border height="500">
|
||||
<el-table-column property="Name" label="名称"></el-table-column>
|
||||
<el-table-column property="MaxBandwidth" label="连接带宽" width="100">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.MaxBandwidth == 65535">无限制</span>
|
||||
<span v-else>{{ scope.row.MaxBandwidth }}Mbps</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="ConnectionRatio" label="连接数" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.ConnectionRatio*100 }}%</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="Delay" label="延迟" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.Delay }}ms</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="Public" label="公开" width="60">
|
||||
<template #default="scope">
|
||||
<el-switch disabled v-model="scope.row.Public " size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="Oper" label="操作" width="65">
|
||||
<template #default="scope">
|
||||
<el-button type="success" size="small" @click="handleConnect(scope.row.Id)">使用</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, watch,computed, onMounted, onUnmounted } from 'vue';
|
||||
@@ -67,7 +98,7 @@ import { ElMessage } from 'element-plus';
|
||||
import { useConnections, useForwardConnections, useSocks5Connections, useTuntapConnections } from './connections';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { injectGlobalData } from '@/provide';
|
||||
import { setRelaySubscribe } from '@/apis/relay';
|
||||
import { relayConnect, setRelaySubscribe } from '@/apis/relay';
|
||||
export default {
|
||||
props: ['modelValue'],
|
||||
emits: ['change','update:modelValue'],
|
||||
@@ -87,6 +118,7 @@ export default {
|
||||
types:{0:'打洞',1:'中继'},
|
||||
transactions:{'forward':'端口转发','tuntap':'虚拟网卡','socks5':'代理转发'},
|
||||
machineName:connections.value.currentName,
|
||||
currentRow:{},
|
||||
data: computed(()=>{
|
||||
return [
|
||||
forwardConnections.value.list[connections.value.current],
|
||||
@@ -94,7 +126,9 @@ export default {
|
||||
socks5Connections.value.list[connections.value.current],
|
||||
].filter(c=>!!c);
|
||||
}),
|
||||
showNodes:false,
|
||||
nodes:[],
|
||||
nodesDic:{},
|
||||
timer:0
|
||||
});
|
||||
watch(() => state.show, (val) => {
|
||||
@@ -115,11 +149,33 @@ export default {
|
||||
const _setRelaySubscribe = ()=>{
|
||||
setRelaySubscribe().then((res)=>{
|
||||
state.nodes = res;
|
||||
state.nodesDic = res.reduce((a,b)=>{
|
||||
a[b.Id] = b.Name;
|
||||
return a;
|
||||
},{});
|
||||
state.timer = setTimeout(_setRelaySubscribe,1000);
|
||||
}).catch(()=>{
|
||||
state.timer = setTimeout(_setRelaySubscribe,1000);
|
||||
});
|
||||
}
|
||||
const handleNode = (row)=>{
|
||||
state.currentRow = row;
|
||||
state.showNodes = true;
|
||||
}
|
||||
const handleConnect = (id)=>{
|
||||
const json = {
|
||||
FromMachineId:globalData.value.config.Client.Id,
|
||||
TransactionId: state.currentRow.TransactionId,
|
||||
ToMachineId: state.currentRow.RemoteMachineId,
|
||||
NodeId:id,
|
||||
};
|
||||
if(json.NodeId == state.currentRow.NodeId){
|
||||
return;
|
||||
}
|
||||
relayConnect(json).then(()=>{}).catch(()=>{});
|
||||
state.showNodes = false;
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
connections.value.updateRealTime(true);
|
||||
_setRelaySubscribe();
|
||||
@@ -130,7 +186,7 @@ export default {
|
||||
})
|
||||
|
||||
return {
|
||||
state,handleDel,hasTunnelRemove
|
||||
state,handleDel,hasTunnelRemove,handleNode,handleConnect
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
<el-table-column property="Name" label="名称"></el-table-column>
|
||||
<el-table-column property="MaxBandwidth" label="连接带宽" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.MaxBandwidth }}Mbps</span>
|
||||
<span v-if="scope.row.MaxBandwidth == 65535">无限制</span>
|
||||
<span v-else>{{ scope.row.MaxBandwidth }}Mbps</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="ConnectionRatio" label="连接数" width="100">
|
||||
|
||||
@@ -21,19 +21,15 @@
|
||||
<Title>linker</Title>
|
||||
<Authors>snltty</Authors>
|
||||
<Company>snltty</Company>
|
||||
<Description>1. 优化点对网和网对网的局域网IP,包括禁用IP,和冲突检测
|
||||
2. 一些UI优化
|
||||
3. 新增socks5代理
|
||||
4. 优化端口转发和内网穿透配置
|
||||
5. 优化网卡的一些东西
|
||||
6. 统一的去中心数据同步,减少bug</Description>
|
||||
<Description>1. 多中继节点服务器
|
||||
6. 测试中,不要更新,不要更新,不要更新</Description>
|
||||
<Copyright>snltty</Copyright>
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<PackageReleaseNotes>linker</PackageReleaseNotes>
|
||||
<Version>1.5.1</Version>
|
||||
<AssemblyVersion>1.5.1</AssemblyVersion>
|
||||
<FileVersion>1.5.1</FileVersion>
|
||||
<Version>1.5.2</Version>
|
||||
<AssemblyVersion>1.5.2</AssemblyVersion>
|
||||
<FileVersion>1.5.2</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
@@ -12,11 +12,13 @@ namespace linker.plugins.relay.client
|
||||
{
|
||||
private readonly FileConfig config;
|
||||
private readonly RelayTestTransfer relayTestTransfer;
|
||||
private readonly RelayTransfer relayTransfer;
|
||||
|
||||
public RelayApiController(FileConfig config, RelayTestTransfer relayTestTransfer)
|
||||
public RelayApiController(FileConfig config, RelayTestTransfer relayTestTransfer, RelayTransfer relayTransfer)
|
||||
{
|
||||
this.config = config;
|
||||
this.relayTestTransfer = relayTestTransfer;
|
||||
this.relayTransfer = relayTransfer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -38,6 +40,22 @@ namespace linker.plugins.relay.client
|
||||
relayTestTransfer.Subscribe();
|
||||
return relayTestTransfer.Nodes;
|
||||
}
|
||||
|
||||
public bool Connect(ApiControllerParamsInfo param)
|
||||
{
|
||||
RelayConnectInfo relayConnectInfo = param.Content.DeJson<RelayConnectInfo>();
|
||||
Console.WriteLine(relayConnectInfo.ToJson());
|
||||
_ = relayTransfer.ConnectAsync(relayConnectInfo.FromMachineId, relayConnectInfo.ToMachineId, relayConnectInfo.TransactionId, relayConnectInfo.NodeId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class RelayConnectInfo
|
||||
{
|
||||
public string FromMachineId { get; set; }
|
||||
public string ToMachineId { get; set; }
|
||||
public string TransactionId { get; set; }
|
||||
public string NodeId { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace linker.plugins.relay.client
|
||||
public void LoadTransports(List<ITransport> list)
|
||||
{
|
||||
Transports = list;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -64,7 +63,7 @@ namespace linker.plugins.relay.client
|
||||
/// <param name="remoteMachineId">对方id</param>
|
||||
/// <param name="transactionId">事务</param>
|
||||
/// <returns></returns>
|
||||
public async Task<ITunnelConnection> ConnectAsync(string fromMachineId, string remoteMachineId, string transactionId)
|
||||
public async Task<ITunnelConnection> ConnectAsync(string fromMachineId, string remoteMachineId, string transactionId, string nodeId = "")
|
||||
{
|
||||
if (connectingDic.TryAdd(remoteMachineId, true) == false)
|
||||
{
|
||||
@@ -88,7 +87,8 @@ namespace linker.plugins.relay.client
|
||||
SecretKey = fileConfig.Data.Client.Relay.Server.SecretKey,
|
||||
TransactionId = transactionId,
|
||||
TransportName = transport.Name,
|
||||
SSL = fileConfig.Data.Client.Relay.Server.SSL
|
||||
SSL = fileConfig.Data.Client.Relay.Server.SSL,
|
||||
NodeId = nodeId
|
||||
};
|
||||
|
||||
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace linker.plugins.relay.client.transport
|
||||
//测试一下延迟
|
||||
if (relayAskResultInfo.Nodes.Count > 1)
|
||||
{
|
||||
relayAskResultInfo.Nodes = await TestDelay(relayAskResultInfo.Nodes);
|
||||
//relayAskResultInfo.Nodes = await TestDelay(relayAskResultInfo.Nodes);
|
||||
}
|
||||
|
||||
//连接中继节点服务器
|
||||
@@ -173,7 +173,15 @@ namespace linker.plugins.relay.client.transport
|
||||
item.Delay = local.Delay + remote.Delay;
|
||||
}
|
||||
}
|
||||
return result.OrderBy(c => c.Delay).ToList();
|
||||
return result.OrderByDescending(c => c.LastTicks)
|
||||
//带宽倒序
|
||||
.OrderByDescending(c => c.MaxBandwidth)
|
||||
//最大连接数倒序
|
||||
.OrderByDescending(c => c.MaxConnection)
|
||||
//连接数比例升序
|
||||
.OrderBy(c => c.ConnectionRatio)
|
||||
//延迟升序
|
||||
.OrderBy(c => c.Delay).ToList();
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -184,6 +192,11 @@ namespace linker.plugins.relay.client.transport
|
||||
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(relayInfo.NodeId) == false)
|
||||
{
|
||||
nodes = nodes.Where(c => c.Id == relayInfo.NodeId).ToList();
|
||||
}
|
||||
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
IPEndPoint ep = node.EndPoint;
|
||||
@@ -249,8 +262,6 @@ namespace linker.plugins.relay.client.transport
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -47,7 +47,11 @@ namespace linker.config
|
||||
}
|
||||
public sealed class RelayMasterInfo
|
||||
{
|
||||
#if DEBUG
|
||||
public string SecretKey { get; set; } = Helper.GlobalString;
|
||||
#else
|
||||
public string SecretKey { get; set; } = Guid.NewGuid().ToString().ToUpper();
|
||||
#endif
|
||||
}
|
||||
public sealed class RelayNodeInfo
|
||||
{
|
||||
@@ -77,7 +81,12 @@ namespace linker.config
|
||||
public bool Public { get; set; }
|
||||
|
||||
public string MasterHost { get; set; } = string.Empty;
|
||||
|
||||
#if DEBUG
|
||||
public string MasterSecretKey { get; set; } = Helper.GlobalString;
|
||||
#else
|
||||
public string MasterSecretKey { get; set; } = string.Empty;
|
||||
#endif
|
||||
}
|
||||
|
||||
[MemoryPackable]
|
||||
|
||||
@@ -58,13 +58,10 @@ namespace linker.plugins.relay.server
|
||||
socket.SafeClose();
|
||||
return;
|
||||
}
|
||||
await socket.SendAsync(new byte[] { 0 });
|
||||
}
|
||||
|
||||
//ask 是发起端来的,那key就是 发起端->目标端, answer的,目标和来源会交换,所以转换一下
|
||||
string key = relayMessage.Type == RelayMessengerType.Ask ? $"{relayMessage.FromId}->{relayMessage.ToId}->{relayMessage.FlowId}" : $"{relayMessage.ToId}->{relayMessage.FromId}->{relayMessage.FlowId}";
|
||||
|
||||
|
||||
//获取缓存
|
||||
RelayCache relayCache = await relayServerNodeTransfer.TryGetRelayCache(key);
|
||||
if (relayCache == null)
|
||||
@@ -86,8 +83,10 @@ namespace linker.plugins.relay.server
|
||||
RelayWrap relayWrap = new RelayWrap { Socket = socket, Tcs = new TaskCompletionSource<Socket>() };
|
||||
relayDic.TryAdd(relayCache.FlowId, relayWrap);
|
||||
|
||||
await socket.SendAsync(new byte[] { 0 });
|
||||
|
||||
//等待对方连接
|
||||
Socket targetSocket = await relayWrap.Tcs.Task.WaitAsync(TimeSpan.FromMilliseconds(3000));
|
||||
Socket targetSocket = await relayWrap.Tcs.Task.WaitAsync(TimeSpan.FromMilliseconds(15000));
|
||||
_ = CopyToAsync(relayCache, 3, socket, targetSocket);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using linker.config;
|
||||
using linker.libs;
|
||||
using linker.libs.extends;
|
||||
using linker.plugins.relay.server.caching;
|
||||
using MemoryPack;
|
||||
using System.Collections.Concurrent;
|
||||
@@ -79,6 +80,7 @@ namespace linker.plugins.relay.server
|
||||
}
|
||||
relayNodeReportInfo.LastTicks = Environment.TickCount64;
|
||||
reports.AddOrUpdate(relayNodeReportInfo.Id, relayNodeReportInfo, (a, b) => relayNodeReportInfo);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace linker.plugins.relay.server
|
||||
{
|
||||
IPEndPoint endPoint = await NetworkHelper.GetEndPointAsync(node.Host, fileConfig.Data.Server.ServicePort) ?? new IPEndPoint(IPAddress.Any, fileConfig.Data.Server.ServicePort);
|
||||
int maxConnection = node.MaxConnection == 0 ? 65535 : node.MaxConnection;
|
||||
double connectionRatio = connectionNum / maxConnection;
|
||||
double connectionRatio = connectionNum/2.0 / maxConnection;
|
||||
double maxBandwidth = node.MaxBandwidth == 0 ? 65535 : node.MaxBandwidth;
|
||||
|
||||
RelayNodeReportInfo relayNodeReportInfo = new RelayNodeReportInfo
|
||||
|
||||
@@ -33,16 +33,16 @@ do
|
||||
fi
|
||||
done
|
||||
cd public/publish/docker/linux-${p}-x64/${f}
|
||||
docker buildx build -f ${target}/public/publish/docker/linux-${p}-x64/${f}/Dockerfile-${p} --platform="linux/x86_64" --force-rm -t "${image}-${p}-x64:latest" -t "${image}-${p}-x64:v1.5.1" . --push
|
||||
docker buildx build -f ${target}/public/publish/docker/linux-${p}-x64/${f}/Dockerfile-${p} --platform="linux/x86_64" --force-rm -t "${image}-${p}-x64:latest" -t "${image}-${p}-x64:v1.5.2" . --push
|
||||
cd ../../../../../
|
||||
|
||||
|
||||
cd public/publish/docker/linux-${p}-arm64/${f}
|
||||
docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm64/${f}/Dockerfile-${p} --platform="linux/arm64" --force-rm -t "${image}-${p}-arm64:latest" -t "${image}-${p}-arm64:v1.5.1" . --push
|
||||
docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm64/${f}/Dockerfile-${p} --platform="linux/arm64" --force-rm -t "${image}-${p}-arm64:latest" -t "${image}-${p}-arm64:v1.5.2" . --push
|
||||
cd ../../../../../
|
||||
|
||||
cd public/publish/docker/linux-${p}-arm/${f}
|
||||
docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm/${f}/Dockerfile-${p} --platform="linux/arm/v7" --force-rm -t "${image}-${p}-arm:latest" -t "${image}-${p}-arm:v1.5.1" . --push
|
||||
docker buildx build -f ${target}/public/publish/docker/linux-${p}-arm/${f}/Dockerfile-${p} --platform="linux/arm/v7" --force-rm -t "${image}-${p}-arm:latest" -t "${image}-${p}-arm:v1.5.2" . --push
|
||||
cd ../../../../../
|
||||
done
|
||||
done
|
||||
12
version.txt
12
version.txt
@@ -1,8 +1,4 @@
|
||||
v1.5.1
|
||||
2024-11-04 17:17:06
|
||||
1. 优化点对网和网对网的局域网IP,包括禁用IP,和冲突检测
|
||||
2. 一些UI优化
|
||||
3. 新增socks5代理
|
||||
4. 优化端口转发和内网穿透配置
|
||||
5. 优化网卡的一些东西
|
||||
6. 统一的去中心数据同步,减少bug
|
||||
v1.5.2
|
||||
2024-11-05 16:01:11
|
||||
1. 多中继节点服务器
|
||||
6. 测试中,不要更新,不要更新,不要更新
|
||||
Reference in New Issue
Block a user