Skip to content

Commit

Permalink
优化服务器代理的内网穿透
Browse files Browse the repository at this point in the history
  • Loading branch information
snltty committed Sep 23, 2024
1 parent 9899a67 commit cf76c73
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 40 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
with:
tag_name: v1.4.1
release_name: v1.4.1.${{ steps.date.outputs.today }}
tag_name: v1.4.2
release_name: v1.4.2.${{ steps.date.outputs.today }}
draft: false
prerelease: false
body: "1. 去除配置同步\r\n2. 调整UI\r\n3. 增加Action参数配置\r\n4. 更新文档"
body: "1. 优化服务器代理穿透,延长UDP超时时间,优化穿透添加逻辑\r\n2. 当提示端口被占用时,可以稍等一段时间再尝试启动穿透\r\n3. 优化配置同步"
- name: upload-win-x86-oss
id: upload-win-x86-oss
uses: tvrcgo/[email protected]
Expand All @@ -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.4.1/linker-win-x86.zip
target-path: /downloads/linker/v1.4.2/linker-win-x86.zip
- name: upload-win-x86
id: upload-win-x86
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-win-x64.zip
target-path: /downloads/linker/v1.4.2/linker-win-x64.zip
- name: upload-win-x64
id: upload-win-x64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-win-arm64.zip
target-path: /downloads/linker/v1.4.2/linker-win-arm64.zip
- name: upload-win-arm64
id: upload-win-arm64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-linux-x64.zip
target-path: /downloads/linker/v1.4.2/linker-linux-x64.zip
- name: upload-linux-x64
id: upload-linux-x64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-linux-arm.zip
target-path: /downloads/linker/v1.4.2/linker-linux-arm.zip
- name: upload-linux-arm
id: upload-linux-arm
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-linux-arm64.zip
target-path: /downloads/linker/v1.4.2/linker-linux-arm64.zip
- name: upload-linux-arm64
id: upload-linux-arm64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-linux-musl-x64.zip
target-path: /downloads/linker/v1.4.2/linker-linux-musl-x64.zip
- name: upload-linux-musl-x64
id: upload-linux-musl-x64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-linux-musl-arm.zip
target-path: /downloads/linker/v1.4.2/linker-linux-musl-arm.zip
- name: upload-linux-musl-arm
id: upload-linux-musl-arm
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-linux-musl-arm64.zip
target-path: /downloads/linker/v1.4.2/linker-linux-musl-arm64.zip
- name: upload-linux-musl-arm64
id: upload-linux-musl-arm64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-osx-x64.zip
target-path: /downloads/linker/v1.4.2/linker-osx-x64.zip
- name: upload-osx-x64
id: upload-osx-x64
uses: actions/upload-release-asset@master
Expand All @@ -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.4.1/linker-osx-arm64.zip
target-path: /downloads/linker/v1.4.2/linker-osx-arm64.zip
- name: upload-osx-arm64
id: upload-osx-arm64
uses: actions/upload-release-asset@master
Expand Down Expand Up @@ -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.4.1/linker-windows-route.zip
target-path: /downloads/linker/v1.4.2/linker-windows-route.zip
- name: upload-windows-route
id: upload-windows-route
uses: actions/upload-release-asset@master
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:

- name: Push
run: |
nuget push ./linker.tunnel/bin/release/linker.tunnel.1.4.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.4.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.4.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.4.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.4.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.4.2.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
6 changes: 3 additions & 3 deletions linker.libs/linker.libs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<Copyright>snltty</Copyright>
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<Version>1.4.1</Version>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>
<Version>1.4.2</Version>
<AssemblyVersion>1.4.2</AssemblyVersion>
<FileVersion>1.4.2</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
Expand Down
6 changes: 3 additions & 3 deletions linker.tun/linker.tun.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<PackageReleaseNotes>linker tun</PackageReleaseNotes>
<Version>1.4.1</Version>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>
<Version>1.4.2</Version>
<AssemblyVersion>1.4.2</AssemblyVersion>
<FileVersion>1.4.2</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
6 changes: 3 additions & 3 deletions linker.tunnel/linker.tunnel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<PackageReleaseNotes>linker tunnel</PackageReleaseNotes>
<Version>1.4.1</Version>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>
<Version>1.4.2</Version>
<AssemblyVersion>1.4.2</AssemblyVersion>
<FileVersion>1.4.2</FileVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
13 changes: 6 additions & 7 deletions linker/linker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
<Title>linker</Title>
<Authors>snltty</Authors>
<Company>snltty</Company>
<Description>1. 去除配置同步
2. 调整UI
3. 增加Action参数配置
4. 更新文档</Description>
<Description>1. 优化服务器代理穿透,延长UDP超时时间,优化穿透添加逻辑
2. 当提示端口被占用时,可以稍等一段时间再尝试启动穿透
3. 优化配置同步</Description>
<Copyright>snltty</Copyright>
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
<PackageReleaseNotes>linker</PackageReleaseNotes>
<Version>1.4.1</Version>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>
<Version>1.4.2</Version>
<AssemblyVersion>1.4.2</AssemblyVersion>
<FileVersion>1.4.2</FileVersion>
</PropertyGroup>


Expand Down
10 changes: 10 additions & 0 deletions linker/plugins/sforward/config/SForwardServerCahing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ public SForwardServerCahing()

public bool TryAdd(string domain, string machineId)
{
if (serverDoamins.TryGetValue(domain, out string _machineId) && machineId == _machineId)
{
return true;
}

return serverDoamins.TryAdd(domain, machineId);
}

public bool TryAdd(int port, string machineId)
{
if (serverPorts.TryGetValue(port, out string _machineId) && machineId == _machineId)
{
return true;
}

return serverPorts.TryAdd(port, machineId);
}

Expand Down
2 changes: 2 additions & 0 deletions linker/plugins/sforward/messenger/SForwardMessenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public async Task Add(IConnection connection)
{
if (sForwardServerCahing.TryAdd(port, connection.Id))
{
proxy.Stop(port);
result.Message = proxy.Start(port, false, configWrap.Data.Server.SForward.BufferSize);
if (string.IsNullOrWhiteSpace(result.Message) == false)
{
Expand Down Expand Up @@ -112,6 +113,7 @@ public async Task Add(IConnection connection)
}
else
{
proxy.Stop(sForwardAddInfo.RemotePort);
string msg = proxy.Start(sForwardAddInfo.RemotePort, false, configWrap.Data.Server.SForward.BufferSize);
if (string.IsNullOrWhiteSpace(msg) == false)
{
Expand Down
11 changes: 5 additions & 6 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
v1.4.1
2024-09-23 10:15:12
1. 去除配置同步
2. 调整UI
3. 增加Action参数配置
4. 更新文档
v1.4.2
2024-09-23 10:35:05
1. 优化服务器代理穿透,延长UDP超时时间,优化穿透添加逻辑
2. 当提示端口被占用时,可以稍等一段时间再尝试启动穿透
3. 优化配置同步

0 comments on commit cf76c73

Please sign in to comment.