mirror of
https://github.com/snltty/linker.git
synced 2025-10-19 07:24:39 +08:00
源生成器替代反射
This commit is contained in:
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.4.8
|
||||
release_name: v1.4.8.${{ steps.date.outputs.today }}
|
||||
tag_name: v1.4.9
|
||||
release_name: v1.4.9.${{ steps.date.outputs.today }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: 1. 使用原生成器替代反射
|
||||
body: "1. 使用原生成器替代反射\r\n2. 统计所有服务端,客户端数量\r\n3. 测试中,请勿更新,请勿更新,请勿更新"
|
||||
- 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.4.8/linker-win-x86.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-win-x64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-win-arm64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-linux-x64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-linux-arm.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-linux-arm64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-linux-musl-x64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-linux-musl-arm.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-linux-musl-arm64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-osx-x64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-osx-arm64.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8/linker-windows-route.zip
|
||||
target-path: /downloads/linker/v1.4.9/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.4.8.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.8.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.8.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.9.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.9.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.9.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NUGET_KEY }} -NoSymbol
|
||||
|
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace linker.gen
|
||||
{
|
||||
|
@@ -14,9 +14,9 @@
|
||||
<Copyright>snltty</Copyright>
|
||||
<PackageProjectUrl>https://github.com/snltty/linker</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/snltty/linker</RepositoryUrl>
|
||||
<Version>1.4.8</Version>
|
||||
<AssemblyVersion>1.4.8</AssemblyVersion>
|
||||
<FileVersion>1.4.8</FileVersion>
|
||||
<Version>1.4.9</Version>
|
||||
<AssemblyVersion>1.4.9</AssemblyVersion>
|
||||
<FileVersion>1.4.9</FileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>full</DebugType>
|
||||
|
BIN
linker.tray.win/dist/linker.tray.win.exe
vendored
BIN
linker.tray.win/dist/linker.tray.win.exe
vendored
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>linker.web</title><script defer="defer" src="js/chunk-vendors.ac5be1e1.js"></script><script defer="defer" src="js/app.a9c17022.js"></script><link href="css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="css/app.acc92c6f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but linker.web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>linker.web</title><script defer="defer" src="js/chunk-vendors.ac5be1e1.js"></script><script defer="defer" src="js/app.c58f6329.js"></script><link href="css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="css/app.acc92c6f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but linker.web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
@@ -1 +1 @@
|
||||
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[340],{9256:function(e,a,t){t.r(a),t.d(a,{default:function(){return M}});var n=t(6768);const l={class:"net-wrap app-wrap"},s={class:"inner absolute flex flex-column flex-nowrap"},r={class:"head"},i={class:"body flex-1 relative"},u={class:"status"};function c(e,a,t,c,d,o){const g=(0,n.g2)("Head"),p=(0,n.g2)("List"),v=(0,n.g2)("Status");return(0,n.uX)(),(0,n.CE)("div",l,[(0,n.Lk)("div",s,[(0,n.Lk)("div",r,[(0,n.bF)(g)]),(0,n.Lk)("div",i,[(0,n.bF)(p)]),(0,n.Lk)("div",u,[(0,n.bF)(v,{config:!1})])])])}t(4114);const d=e=>((0,n.Qi)("data-v-213d85ba"),e=e(),(0,n.jt)(),e),o={class:"head-wrap"},g={class:"tools flex"},p=d((()=>(0,n.Lk)("span",{class:"label"},"服务器 ",-1))),v=d((()=>(0,n.Lk)("span",{class:"flex-1"},null,-1))),h={style:{"margin-left":"1rem"}};function f(e,a,t,l,s,r){const i=(0,n.g2)("el-option"),u=(0,n.g2)("el-select"),c=(0,n.g2)("Refresh"),d=(0,n.g2)("el-icon"),f=(0,n.g2)("el-button"),k=(0,n.g2)("Background");return(0,n.uX)(),(0,n.CE)("div",o,[(0,n.Lk)("div",g,[p,(0,n.bF)(u,{modelValue:l.state.server,"onUpdate:modelValue":a[0]||(a[0]=e=>l.state.server=e),placeholder:"服务器",style:{width:"16rem"},size:"small"},{default:(0,n.k6)((()=>[((0,n.uX)(!0),(0,n.CE)(n.FK,null,(0,n.pI)(l.state.servers,(e=>((0,n.uX)(),(0,n.Wv)(i,{key:e.Host,label:e.Name,value:e.Host},null,8,["label","value"])))),128))])),_:1},8,["modelValue"]),v,(0,n.bF)(f,{size:"small",onClick:l.handleRefresh},{default:(0,n.k6)((()=>[(0,n.eW)(" 刷新(F5)"),(0,n.bF)(d,null,{default:(0,n.k6)((()=>[(0,n.bF)(c)])),_:1})])),_:1},8,["onClick"]),(0,n.Lk)("div",h,[(0,n.bF)(k,{name:"net"})])])])}var k=t(3830),m=t(144),b=t(7477),C=t(5096),L={components:{Edit:b.ffu,Refresh:b.C42,Background:C.A},setup(){const e=(0,k.B)(),a=(0,m.Kh)({server:"linker.snltty.com:1802",servers:[]});(0,n.wB)((()=>e.value.config.Client.Servers),(()=>{a.servers=(e.value.config.Client.Servers||[]).slice(0,1),a.server=e.value.config.Client.ServerInfo.Host}));const t=()=>{window.location.reload()};return{state:a,handleRefresh:t}}},w=t(1241);const S=(0,w.A)(L,[["render",f],["__scopeId","data-v-213d85ba"]]);var _=S;const F=e=>((0,n.Qi)("data-v-b6ab4f06"),e=e(),(0,n.jt)(),e),x={class:"net-list-wrap flex flex-column absolute"},z={class:"flex-1 scrollbar"},I={class:"flex"},E=F((()=>(0,n.Lk)("div",{class:"flex-1"},null,-1))),T={class:"tuntap"},A={class:"page t-c"},B={class:"page-wrap t-c"};function P(e,a,t,l,s,r){const i=(0,n.g2)("DeviceName"),u=(0,n.g2)("UpdaterBtn"),c=(0,n.g2)("TuntapShow"),d=(0,n.g2)("el-pagination");return(0,n.uX)(),(0,n.CE)("div",x,[(0,n.Lk)("div",z,[(0,n.Lk)("ul",null,[((0,n.uX)(!0),(0,n.CE)(n.FK,null,(0,n.pI)(l.devices.page.List,((e,a)=>((0,n.uX)(),(0,n.CE)("li",{key:a},[(0,n.Lk)("dl",null,[(0,n.Lk)("dt",I,[(0,n.Lk)("div",null,[(0,n.bF)(i,{item:e},null,8,["item"])]),E,(0,n.Lk)("div",null,[(0,n.bF)(u,{config:!1,item:e},null,8,["item"])])]),(0,n.Lk)("dd",T,[l.tuntap.list[e.MachineId]?((0,n.uX)(),(0,n.Wv)(c,{key:0,item:e},null,8,["item"])):(0,n.Q3)("",!0)])])])))),128))])]),(0,n.Lk)("div",A,[(0,n.Lk)("div",B,[(0,n.bF)(d,{size:"small",background:"",layout:"prev,pager, next","pager-count":5,total:l.devices.page.Count,"page-size":l.devices.page.Request.Size,"current-page":l.devices.page.Request.Page,onCurrentChange:l.handlePageChange,onSizeChange:l.handlePageSizeChange,"page-sizes":[10,20,50,100,255]},null,8,["total","page-size","current-page","onCurrentChange","onSizeChange"])])])])}var y=t(8104),X=t(7985),R=t(9383),D=t(2126),U=t(886),H=t(1198),N={components:{StarFilled:b.BQ2,UpdaterBtn:D.A,DeviceName:U.A,TuntapShow:H.A},setup(e){(0,k.B)();const a=(0,m.Kh)({}),{devices:t,machineId:l,_getSignList:s,_getSignList1:r,handleDeviceEdit:i,handlePageChange:u,handlePageSizeChange:c,handleDel:d,clearDevicesTimeout:o}=(0,X.r)(),{tuntap:g,_getTuntapInfo:p,handleTuntapRefresh:v,clearTuntapTimeout:h,handleTuntapEdit:f,sortTuntapIP:b}=(0,y.O)(),{_getUpdater:C,_subscribeUpdater:L,clearUpdaterTimeout:w}=(0,R.d)();return(0,n.sV)((()=>{u(),v(),s(),r(),p(),C(),L()})),(0,n.hi)((()=>{o(),h(),w()})),{state:a,devices:t,machineId:l,handlePageChange:u,handlePageSizeChange:c,tuntap:g}}};const V=(0,w.A)(N,[["render",P],["__scopeId","data-v-b6ab4f06"]]);var K=V,Q=t(9762),W=t(1387),j={components:{Head:_,List:K,Status:Q.A},setup(){document.addEventListener("contextmenu",(function(e){e.preventDefault()}));const e=(0,k.B)(),a=(0,W.rd)();return(0,n.sV)((()=>{0==e.value.hasAccess("NetManager")&&a.push({name:"NoPermission"})})),{}}};const q=(0,w.A)(j,[["render",c],["__scopeId","data-v-6a3f3b43"]]);var M=q}}]);
|
||||
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[439],{9256:function(e,a,t){t.r(a),t.d(a,{default:function(){return M}});var n=t(6768);const l={class:"net-wrap app-wrap"},s={class:"inner absolute flex flex-column flex-nowrap"},r={class:"head"},i={class:"body flex-1 relative"},u={class:"status"};function c(e,a,t,c,d,o){const g=(0,n.g2)("Head"),p=(0,n.g2)("List"),v=(0,n.g2)("Status");return(0,n.uX)(),(0,n.CE)("div",l,[(0,n.Lk)("div",s,[(0,n.Lk)("div",r,[(0,n.bF)(g)]),(0,n.Lk)("div",i,[(0,n.bF)(p)]),(0,n.Lk)("div",u,[(0,n.bF)(v,{config:!1})])])])}t(4114);const d=e=>((0,n.Qi)("data-v-213d85ba"),e=e(),(0,n.jt)(),e),o={class:"head-wrap"},g={class:"tools flex"},p=d((()=>(0,n.Lk)("span",{class:"label"},"服务器 ",-1))),v=d((()=>(0,n.Lk)("span",{class:"flex-1"},null,-1))),h={style:{"margin-left":"1rem"}};function f(e,a,t,l,s,r){const i=(0,n.g2)("el-option"),u=(0,n.g2)("el-select"),c=(0,n.g2)("Refresh"),d=(0,n.g2)("el-icon"),f=(0,n.g2)("el-button"),k=(0,n.g2)("Background");return(0,n.uX)(),(0,n.CE)("div",o,[(0,n.Lk)("div",g,[p,(0,n.bF)(u,{modelValue:l.state.server,"onUpdate:modelValue":a[0]||(a[0]=e=>l.state.server=e),placeholder:"服务器",style:{width:"16rem"},size:"small"},{default:(0,n.k6)((()=>[((0,n.uX)(!0),(0,n.CE)(n.FK,null,(0,n.pI)(l.state.servers,(e=>((0,n.uX)(),(0,n.Wv)(i,{key:e.Host,label:e.Name,value:e.Host},null,8,["label","value"])))),128))])),_:1},8,["modelValue"]),v,(0,n.bF)(f,{size:"small",onClick:l.handleRefresh},{default:(0,n.k6)((()=>[(0,n.eW)(" 刷新(F5)"),(0,n.bF)(d,null,{default:(0,n.k6)((()=>[(0,n.bF)(c)])),_:1})])),_:1},8,["onClick"]),(0,n.Lk)("div",h,[(0,n.bF)(k,{name:"net"})])])])}var k=t(3830),m=t(144),b=t(7477),C=t(5096),L={components:{Edit:b.ffu,Refresh:b.C42,Background:C.A},setup(){const e=(0,k.B)(),a=(0,m.Kh)({server:"linker.snltty.com:1802",servers:[]});(0,n.wB)((()=>e.value.config.Client.Servers),(()=>{a.servers=(e.value.config.Client.Servers||[]).slice(0,1),a.server=e.value.config.Client.ServerInfo.Host}));const t=()=>{window.location.reload()};return{state:a,handleRefresh:t}}},w=t(1241);const S=(0,w.A)(L,[["render",f],["__scopeId","data-v-213d85ba"]]);var _=S;const F=e=>((0,n.Qi)("data-v-b6ab4f06"),e=e(),(0,n.jt)(),e),x={class:"net-list-wrap flex flex-column absolute"},z={class:"flex-1 scrollbar"},I={class:"flex"},E=F((()=>(0,n.Lk)("div",{class:"flex-1"},null,-1))),T={class:"tuntap"},A={class:"page t-c"},B={class:"page-wrap t-c"};function P(e,a,t,l,s,r){const i=(0,n.g2)("DeviceName"),u=(0,n.g2)("UpdaterBtn"),c=(0,n.g2)("TuntapShow"),d=(0,n.g2)("el-pagination");return(0,n.uX)(),(0,n.CE)("div",x,[(0,n.Lk)("div",z,[(0,n.Lk)("ul",null,[((0,n.uX)(!0),(0,n.CE)(n.FK,null,(0,n.pI)(l.devices.page.List,((e,a)=>((0,n.uX)(),(0,n.CE)("li",{key:a},[(0,n.Lk)("dl",null,[(0,n.Lk)("dt",I,[(0,n.Lk)("div",null,[(0,n.bF)(i,{item:e},null,8,["item"])]),E,(0,n.Lk)("div",null,[(0,n.bF)(u,{config:!1,item:e},null,8,["item"])])]),(0,n.Lk)("dd",T,[l.tuntap.list[e.MachineId]?((0,n.uX)(),(0,n.Wv)(c,{key:0,item:e},null,8,["item"])):(0,n.Q3)("",!0)])])])))),128))])]),(0,n.Lk)("div",A,[(0,n.Lk)("div",B,[(0,n.bF)(d,{size:"small",background:"",layout:"prev,pager, next","pager-count":5,total:l.devices.page.Count,"page-size":l.devices.page.Request.Size,"current-page":l.devices.page.Request.Page,onCurrentChange:l.handlePageChange,onSizeChange:l.handlePageSizeChange,"page-sizes":[10,20,50,100,255]},null,8,["total","page-size","current-page","onCurrentChange","onSizeChange"])])])])}var y=t(8104),X=t(7985),R=t(9383),D=t(2126),U=t(886),H=t(1198),N={components:{StarFilled:b.BQ2,UpdaterBtn:D.A,DeviceName:U.A,TuntapShow:H.A},setup(e){(0,k.B)();const a=(0,m.Kh)({}),{devices:t,machineId:l,_getSignList:s,_getSignList1:r,handleDeviceEdit:i,handlePageChange:u,handlePageSizeChange:c,handleDel:d,clearDevicesTimeout:o}=(0,X.r)(),{tuntap:g,_getTuntapInfo:p,handleTuntapRefresh:v,clearTuntapTimeout:h,handleTuntapEdit:f,sortTuntapIP:b}=(0,y.O)(),{_getUpdater:C,_subscribeUpdater:L,clearUpdaterTimeout:w}=(0,R.d)();return(0,n.sV)((()=>{u(),v(),s(),r(),p(),C(),L()})),(0,n.hi)((()=>{o(),h(),w()})),{state:a,devices:t,machineId:l,handlePageChange:u,handlePageSizeChange:c,tuntap:g}}};const V=(0,w.A)(N,[["render",P],["__scopeId","data-v-b6ab4f06"]]);var K=V,Q=t(4569),W=t(1387),j={components:{Head:_,List:K,Status:Q.A},setup(){document.addEventListener("contextmenu",(function(e){e.preventDefault()}));const e=(0,k.B)(),a=(0,W.rd)();return(0,n.sV)((()=>{0==e.value.hasAccess("NetManager")&&a.push({name:"NoPermission"})})),{}}};const q=(0,w.A)(j,[["render",c],["__scopeId","data-v-6a3f3b43"]]);var M=q}}]);
|
1
linker.tray.win/web/js/900.47b56757.js
Normal file
1
linker.tray.win/web/js/900.47b56757.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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.8</Version>
|
||||
<AssemblyVersion>1.4.8</AssemblyVersion>
|
||||
<FileVersion>1.4.8</FileVersion>
|
||||
<Version>1.4.9</Version>
|
||||
<AssemblyVersion>1.4.9</AssemblyVersion>
|
||||
<FileVersion>1.4.9</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.4.8</Version>
|
||||
<AssemblyVersion>1.4.8</AssemblyVersion>
|
||||
<FileVersion>1.4.8</FileVersion>
|
||||
<Version>1.4.9</Version>
|
||||
<AssemblyVersion>1.4.9</AssemblyVersion>
|
||||
<FileVersion>1.4.9</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
@@ -27,12 +27,13 @@ export const provideGlobalData = () => {
|
||||
updater: {}, //更新信息
|
||||
self: {}, //本机
|
||||
hasAccess(name) {
|
||||
|
||||
if (this.config.Client.Accesss[name] == undefined) {
|
||||
return false;
|
||||
}
|
||||
const value = this.config.Client.Accesss[name].Value || -1;
|
||||
const access = this.config.Client.Access || -1;
|
||||
return access >= 0 && (access == 0 || ((access & value) >>> 0) == value);
|
||||
return access >= 0 && (access == 0 || (+(BigInt(access) & BigInt(value)).toString()) == value);
|
||||
}
|
||||
});
|
||||
subWebsocketState((state) => {
|
||||
|
@@ -2,26 +2,30 @@
|
||||
<div class="status-server-wrap">
|
||||
<ServerConfig :config="config"></ServerConfig>
|
||||
<ServerVersion :config="config"></ServerVersion>
|
||||
<ServerFlow v-if="config" :config="config"></ServerFlow>
|
||||
<ServerFlow v-if="config && hasFlow" :config="config"></ServerFlow>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive } from 'vue';
|
||||
import { computed, reactive } from 'vue';
|
||||
import ServerConfig from './ServerConfig.vue';
|
||||
import ServerFlow from './ServerFlow.vue';
|
||||
import ServerVersion from './ServerVersion.vue';
|
||||
import { injectGlobalData } from '@/provide';
|
||||
export default {
|
||||
components:{ServerConfig,ServerFlow,ServerVersion},
|
||||
props:['config'],
|
||||
setup(props) {
|
||||
|
||||
const globalData = injectGlobalData();
|
||||
const hasFlow = computed(()=>globalData.value.hasAccess('Flow'));
|
||||
|
||||
const state = reactive({
|
||||
show: false,
|
||||
loading: false
|
||||
});
|
||||
|
||||
return {
|
||||
config:props.config, state
|
||||
config:props.config,hasFlow, state
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a v-if="config" href="javascript:;" title="linker服务端网速,点击查看详细信息" @click="handleShow">
|
||||
<p>在线 {{state.overallOnline}}</p>
|
||||
<p>在线 {{state.overallOnline}}、{{ state.serverOnline }}</p>
|
||||
<p>上传 {{state.overallSendtSpeed}}/s</p>
|
||||
<p>下载 {{state.overallReceiveSpeed}}/s</p>
|
||||
</a>
|
||||
@@ -56,12 +56,14 @@ export default {
|
||||
const globalData = injectGlobalData();
|
||||
const hasSForwardFlow = computed(()=>globalData.value.hasAccess('SForwardFlow'));
|
||||
const hasRelayFlow = computed(()=>globalData.value.hasAccess('RelayFlow'));
|
||||
const hasSigninFlow = computed(()=>globalData.value.hasAccess('SigninFlow'));
|
||||
const state = reactive({
|
||||
show:false,
|
||||
timer:0,
|
||||
overallSendtSpeed: '0000.00KB',
|
||||
overallReceiveSpeed: '0000.00KB',
|
||||
overallOnline: '0/0',
|
||||
serverOnline: '0/0/0',
|
||||
time:'',
|
||||
list:[],
|
||||
old:null,
|
||||
@@ -80,7 +82,7 @@ export default {
|
||||
const id2text = {
|
||||
'External':{text:'外网端口',detail:false},
|
||||
'Relay':{text:'中继',detail:hasRelayFlow.value},
|
||||
'Messenger':{text:'信标',detail:true},
|
||||
'Messenger':{text:'信标',detail:hasSigninFlow.value},
|
||||
'SForward':{text:'内网穿透',detail:hasSForwardFlow.value},
|
||||
};
|
||||
const _getFlows = ()=>{
|
||||
@@ -91,6 +93,13 @@ export default {
|
||||
state.overallOnline = `${res.Items['_'].SendtBytes}/${res.Items['_'].ReceiveBytes}`;
|
||||
delete res.Items['_'];
|
||||
}
|
||||
if(res.Items['flow']){
|
||||
const online = (res.Items['flow'].ReceiveBytes >> 4) & 0xffffffff;
|
||||
const total = res.Items['flow'].ReceiveBytes & 0xffffffff;
|
||||
const server = res.Items['flow'].SendtBytes;
|
||||
state.serverOnline = `${online}/${total}/${server}`;
|
||||
delete res.Items['flow'];
|
||||
}
|
||||
|
||||
let _receiveBytes = 0,_sendtBytes = 0,receiveBytes = 0,sendtBytes = 0;
|
||||
for(let j in old.Items){
|
||||
|
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>False|2024-10-10T14:16:16.3110909Z||;False|2024-10-10T22:11:21.0881724+08:00||;False|2024-10-10T22:09:10.1989910+08:00||;False|2024-10-10T21:50:21.7296489+08:00||;False|2024-10-10T21:47:58.4483180+08:00||;False|2024-10-10T21:45:03.8865649+08:00||;False|2024-10-10T17:35:43.5322585+08:00||;False|2024-10-10T17:26:43.3077023+08:00||;True|2024-10-10T17:26:30.3061770+08:00||;True|2024-10-10T17:19:53.7202305+08:00||;False|2024-10-10T17:19:30.0472147+08:00||;False|2024-10-10T17:09:11.5458248+08:00||;False|2024-10-10T17:05:01.9807383+08:00||;False|2024-10-10T16:32:47.9197855+08:00||;False|2024-10-10T16:27:33.3843344+08:00||;False|2024-10-10T16:17:45.5400935+08:00||;False|2024-10-10T16:16:00.7310907+08:00||;False|2024-10-10T16:11:16.4527258+08:00||;False|2024-10-10T16:01:49.3234495+08:00||;False|2024-10-10T16:00:52.7042699+08:00||;False|2024-10-10T15:58:26.2250525+08:00||;False|2024-10-10T15:29:21.2118650+08:00||;False|2024-10-10T15:27:57.3759612+08:00||;False|2024-10-10T15:26:24.8835185+08:00||;False|2024-10-10T15:24:48.1428403+08:00||;False|2024-10-10T15:23:40.7151355+08:00||;False|2024-10-10T15:23:27.3693403+08:00||;False|2024-10-10T15:22:30.7759285+08:00||;False|2024-10-10T15:20:07.4952154+08:00||;False|2024-10-10T15:14:25.2072081+08:00||;False|2024-10-10T15:06:41.7786909+08:00||;False|2024-10-10T15:05:22.2113720+08:00||;False|2024-10-10T15:00:57.3305970+08:00||;False|2024-10-10T15:00:48.3682184+08:00||;False|2024-10-10T14:59:37.0795714+08:00||;False|2024-10-10T14:56:38.0161474+08:00||;False|2024-10-10T14:54:00.5195838+08:00||;True|2024-10-10T11:44:31.3807621+08:00||;True|2024-10-10T11:42:10.9702062+08:00||;True|2024-10-10T11:38:58.4038620+08:00||;True|2024-10-10T11:34:46.6640510+08:00||;True|2024-10-10T11:31:11.4793243+08:00||;True|2024-10-10T11:29:18.5541962+08:00||;False|2024-10-10T11:28:45.6627606+08:00||;True|2024-08-23T10:51:58.4468622+08:00||;True|2024-08-23T10:50:24.9490093+08:00||;True|2024-08-23T10:47:22.7180336+08:00||;True|2024-08-23T10:44:58.5670901+08:00||;True|2024-08-23T10:43:21.8874172+08:00||;True|2024-08-23T10:42:36.6889366+08:00||;True|2024-08-23T10:41:53.5656929+08:00||;True|2024-08-23T10:41:48.6036362+08:00||;True|2024-08-23T10:40:09.3649807+08:00||;True|2024-08-23T10:39:32.4793121+08:00||;False|2024-08-23T10:39:19.4117931+08:00||;True|2024-08-23T10:35:42.9767722+08:00||;True|2024-08-23T10:35:00.2434227+08:00||;True|2024-08-23T10:33:52.2828327+08:00||;True|2024-08-23T10:32:48.1055213+08:00||;True|2024-08-23T10:30:54.0109448+08:00||;True|2024-08-23T10:27:57.3877299+08:00||;True|2024-08-23T10:27:54.0431848+08:00||;True|2024-08-23T10:27:30.2617469+08:00||;True|2024-08-23T10:24:27.5920712+08:00||;True|2024-08-23T10:21:09.9703353+08:00||;True|2024-08-23T10:18:55.2035793+08:00||;True|2024-08-23T10:18:34.9805916+08:00||;True|2024-08-23T10:18:20.6676415+08:00||;True|2024-08-23T10:17:38.1634986+08:00||;True|2024-08-23T10:16:28.1682988+08:00||;True|2024-08-23T10:00:48.4543408+08:00||;True|2024-08-23T09:55:05.4757944+08:00||;False|2024-08-23T09:54:27.3467579+08:00||;True|2024-08-23T09:50:36.2439630+08:00||;False|2024-08-23T09:50:11.6253822+08:00||;False|2024-08-23T09:49:56.1119041+08:00||;False|2024-08-23T09:49:41.8313525+08:00||;True|2024-08-23T09:47:09.0982192+08:00||;True|2024-08-23T09:46:12.1445883+08:00||;True|2024-07-01T17:25:46.1203574+08:00||;True|2024-06-02T15:39:16.1880914+08:00||;True|2024-06-02T15:38:26.4314913+08:00||;True|2024-06-02T15:27:20.2651650+08:00||;True|2024-06-02T15:26:34.3414728+08:00||;True|2024-06-02T15:22:33.1407820+08:00||;True|2024-06-02T15:22:01.4381533+08:00||;True|2024-06-02T15:20:29.6692030+08:00||;True|2024-06-02T15:19:55.9152032+08:00||;True|2024-06-02T15:16:15.2278365+08:00||;True|2024-04-23T09:09:03.5136215+08:00||;True|2024-04-22T12:57:38.4988098+08:00||;True|2023-12-23T09:50:45.7841097+08:00||;True|2023-11-17T09:24:26.3650754+08:00||;True|2023-11-17T09:11:28.0867966+08:00||;True|2023-11-17T09:09:49.7366925+08:00||;False|2023-11-17T09:08:56.6254247+08:00||;False|2023-11-17T09:08:45.4560896+08:00||;True|2023-11-16T11:49:56.3722044+08:00||;True|2023-11-16T11:48:06.3192199+08:00||;True|2023-11-16T11:47:35.3708397+08:00||;</History>
|
||||
<History>False|2024-10-10T14:32:46.3888438Z||;False|2024-10-10T22:16:16.3110909+08:00||;False|2024-10-10T22:11:21.0881724+08:00||;False|2024-10-10T22:09:10.1989910+08:00||;False|2024-10-10T21:50:21.7296489+08:00||;False|2024-10-10T21:47:58.4483180+08:00||;False|2024-10-10T21:45:03.8865649+08:00||;False|2024-10-10T17:35:43.5322585+08:00||;False|2024-10-10T17:26:43.3077023+08:00||;True|2024-10-10T17:26:30.3061770+08:00||;True|2024-10-10T17:19:53.7202305+08:00||;False|2024-10-10T17:19:30.0472147+08:00||;False|2024-10-10T17:09:11.5458248+08:00||;False|2024-10-10T17:05:01.9807383+08:00||;False|2024-10-10T16:32:47.9197855+08:00||;False|2024-10-10T16:27:33.3843344+08:00||;False|2024-10-10T16:17:45.5400935+08:00||;False|2024-10-10T16:16:00.7310907+08:00||;False|2024-10-10T16:11:16.4527258+08:00||;False|2024-10-10T16:01:49.3234495+08:00||;False|2024-10-10T16:00:52.7042699+08:00||;False|2024-10-10T15:58:26.2250525+08:00||;False|2024-10-10T15:29:21.2118650+08:00||;False|2024-10-10T15:27:57.3759612+08:00||;False|2024-10-10T15:26:24.8835185+08:00||;False|2024-10-10T15:24:48.1428403+08:00||;False|2024-10-10T15:23:40.7151355+08:00||;False|2024-10-10T15:23:27.3693403+08:00||;False|2024-10-10T15:22:30.7759285+08:00||;False|2024-10-10T15:20:07.4952154+08:00||;False|2024-10-10T15:14:25.2072081+08:00||;False|2024-10-10T15:06:41.7786909+08:00||;False|2024-10-10T15:05:22.2113720+08:00||;False|2024-10-10T15:00:57.3305970+08:00||;False|2024-10-10T15:00:48.3682184+08:00||;False|2024-10-10T14:59:37.0795714+08:00||;False|2024-10-10T14:56:38.0161474+08:00||;False|2024-10-10T14:54:00.5195838+08:00||;True|2024-10-10T11:44:31.3807621+08:00||;True|2024-10-10T11:42:10.9702062+08:00||;True|2024-10-10T11:38:58.4038620+08:00||;True|2024-10-10T11:34:46.6640510+08:00||;True|2024-10-10T11:31:11.4793243+08:00||;True|2024-10-10T11:29:18.5541962+08:00||;False|2024-10-10T11:28:45.6627606+08:00||;True|2024-08-23T10:51:58.4468622+08:00||;True|2024-08-23T10:50:24.9490093+08:00||;True|2024-08-23T10:47:22.7180336+08:00||;True|2024-08-23T10:44:58.5670901+08:00||;True|2024-08-23T10:43:21.8874172+08:00||;True|2024-08-23T10:42:36.6889366+08:00||;True|2024-08-23T10:41:53.5656929+08:00||;True|2024-08-23T10:41:48.6036362+08:00||;True|2024-08-23T10:40:09.3649807+08:00||;True|2024-08-23T10:39:32.4793121+08:00||;False|2024-08-23T10:39:19.4117931+08:00||;True|2024-08-23T10:35:42.9767722+08:00||;True|2024-08-23T10:35:00.2434227+08:00||;True|2024-08-23T10:33:52.2828327+08:00||;True|2024-08-23T10:32:48.1055213+08:00||;True|2024-08-23T10:30:54.0109448+08:00||;True|2024-08-23T10:27:57.3877299+08:00||;True|2024-08-23T10:27:54.0431848+08:00||;True|2024-08-23T10:27:30.2617469+08:00||;True|2024-08-23T10:24:27.5920712+08:00||;True|2024-08-23T10:21:09.9703353+08:00||;True|2024-08-23T10:18:55.2035793+08:00||;True|2024-08-23T10:18:34.9805916+08:00||;True|2024-08-23T10:18:20.6676415+08:00||;True|2024-08-23T10:17:38.1634986+08:00||;True|2024-08-23T10:16:28.1682988+08:00||;True|2024-08-23T10:00:48.4543408+08:00||;True|2024-08-23T09:55:05.4757944+08:00||;False|2024-08-23T09:54:27.3467579+08:00||;True|2024-08-23T09:50:36.2439630+08:00||;False|2024-08-23T09:50:11.6253822+08:00||;False|2024-08-23T09:49:56.1119041+08:00||;False|2024-08-23T09:49:41.8313525+08:00||;True|2024-08-23T09:47:09.0982192+08:00||;True|2024-08-23T09:46:12.1445883+08:00||;True|2024-07-01T17:25:46.1203574+08:00||;True|2024-06-02T15:39:16.1880914+08:00||;True|2024-06-02T15:38:26.4314913+08:00||;True|2024-06-02T15:27:20.2651650+08:00||;True|2024-06-02T15:26:34.3414728+08:00||;True|2024-06-02T15:22:33.1407820+08:00||;True|2024-06-02T15:22:01.4381533+08:00||;True|2024-06-02T15:20:29.6692030+08:00||;True|2024-06-02T15:19:55.9152032+08:00||;True|2024-06-02T15:16:15.2278365+08:00||;True|2024-04-23T09:09:03.5136215+08:00||;True|2024-04-22T12:57:38.4988098+08:00||;True|2023-12-23T09:50:45.7841097+08:00||;True|2023-11-17T09:24:26.3650754+08:00||;True|2023-11-17T09:11:28.0867966+08:00||;True|2023-11-17T09:09:49.7366925+08:00||;False|2023-11-17T09:08:56.6254247+08:00||;False|2023-11-17T09:08:45.4560896+08:00||;True|2023-11-16T11:49:56.3722044+08:00||;True|2023-11-16T11:48:06.3192199+08:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
@@ -12,6 +12,8 @@
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<PublishAot>false</PublishAot>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
|
||||
<JsonSerializerIsReflectionEnabledByDefault>true</JsonSerializerIsReflectionEnabledByDefault>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<EnablePreviewFeatures>true</EnablePreviewFeatures>
|
||||
@@ -19,14 +21,16 @@
|
||||
<Title>linker</Title>
|
||||
<Authors>snltty</Authors>
|
||||
<Company>snltty</Company>
|
||||
<Description>1. 使用原生成器替代反射</Description>
|
||||
<Description>1. 使用原生成器替代反射
|
||||
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.8</Version>
|
||||
<AssemblyVersion>1.4.8</AssemblyVersion>
|
||||
<FileVersion>1.4.8</FileVersion>
|
||||
<Version>1.4.9</Version>
|
||||
<AssemblyVersion>1.4.9</AssemblyVersion>
|
||||
<FileVersion>1.4.9</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
@@ -273,6 +273,12 @@ namespace linker.config
|
||||
[ClientAccessDisplayAttribute("查看中继流量")]
|
||||
RelayFlow = ((ulong)1 << 31),
|
||||
|
||||
[ClientAccessDisplayAttribute("查看信标流量")]
|
||||
SigninFlow = ((ulong)1 << 32),
|
||||
|
||||
[ClientAccessDisplayAttribute("查看流量")]
|
||||
Flow = ((ulong)1 << 33),
|
||||
|
||||
Full = ulong.MaxValue >> (64 - 52),
|
||||
}
|
||||
|
||||
|
122
linker/plugins/flow/FlowResolver.cs
Normal file
122
linker/plugins/flow/FlowResolver.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
using linker.libs;
|
||||
using linker.libs.extends;
|
||||
using linker.plugins.resolver;
|
||||
using linker.plugins.signin.messenger;
|
||||
using System.Buffers;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace linker.plugins.flow
|
||||
{
|
||||
public sealed class FlowResolver : IResolver, IFlow
|
||||
{
|
||||
public ResolverType Type => ResolverType.Flow;
|
||||
public string FlowName => "flow";
|
||||
|
||||
/// <summary>
|
||||
/// 在线 | 总数
|
||||
/// </summary>
|
||||
public ulong ReceiveBytes { get; private set; }
|
||||
/// <summary>
|
||||
/// 服务器数
|
||||
/// </summary>
|
||||
public ulong SendtBytes { get; private set; }
|
||||
|
||||
|
||||
private ConcurrentDictionary<IPEndPoint, OnlineFlowInfo> servers = new ConcurrentDictionary<IPEndPoint, OnlineFlowInfo>();
|
||||
private readonly SignCaching signCaching;
|
||||
public FlowResolver(SignCaching signCaching)
|
||||
{
|
||||
this.signCaching = signCaching;
|
||||
OnlineTask();
|
||||
}
|
||||
|
||||
public async Task Resolve(Socket socket, Memory<byte> memory)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
public async Task Resolve(Socket socket, IPEndPoint ep, Memory<byte> memory)
|
||||
{
|
||||
try
|
||||
{
|
||||
long time = Environment.TickCount64;
|
||||
|
||||
if (servers.TryGetValue(ep, out OnlineFlowInfo onlineFlowInfo) == false)
|
||||
{
|
||||
onlineFlowInfo = new OnlineFlowInfo { Time = time };
|
||||
servers.TryAdd(ep, onlineFlowInfo);
|
||||
}
|
||||
onlineFlowInfo.Time = time;
|
||||
onlineFlowInfo.Online = memory.Slice(1, 4).ToInt32();
|
||||
onlineFlowInfo.Total = memory.Slice(5, 4).ToInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void OnlineTask()
|
||||
{
|
||||
TimerHelper.SetInterval(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Counter();
|
||||
Report();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return true;
|
||||
}, 5000);
|
||||
}
|
||||
private void Counter()
|
||||
{
|
||||
long time = Environment.TickCount64;
|
||||
List<IPEndPoint> keys = servers.Where(c => time - c.Value.Time > 5000).Select(c => c.Key).ToList();
|
||||
|
||||
foreach (IPEndPoint key in keys)
|
||||
{
|
||||
servers.TryRemove(key, out _);
|
||||
}
|
||||
|
||||
ulong online = (ulong)servers.Sum(c => c.Value.Online) << 32;
|
||||
ulong total = (ulong)servers.Sum(c => c.Value.Total);
|
||||
|
||||
ReceiveBytes = online | total;
|
||||
SendtBytes = (ulong)servers.Count;
|
||||
}
|
||||
private void Report()
|
||||
{
|
||||
byte[] buffer = ArrayPool<byte>.Shared.Rent(9);
|
||||
|
||||
try
|
||||
{
|
||||
signCaching.GetOnline(out int total, out int onlone);
|
||||
buffer[0] = (byte)ResolverType.Flow;
|
||||
onlone.ToBytes(buffer.AsMemory(1));
|
||||
total.ToBytes(buffer.AsMemory(5));
|
||||
|
||||
using UdpClient udpClient = new UdpClient(AddressFamily.InterNetwork);
|
||||
udpClient.Client.WindowsUdpBug();
|
||||
|
||||
udpClient.Send(buffer.AsSpan(0, 9), "linker.snltty.com", 1802);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
ArrayPool<byte>.Shared.Return(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class OnlineFlowInfo
|
||||
{
|
||||
public long Time { get; set; }
|
||||
public int Online { get; set; }
|
||||
public int Total { get; set; }
|
||||
}
|
||||
}
|
@@ -23,6 +23,7 @@ namespace linker.plugins.flow
|
||||
{
|
||||
serviceCollection.AddSingleton<FlowMessenger>();
|
||||
serviceCollection.AddSingleton<FlowTransfer>();
|
||||
serviceCollection.AddSingleton<FlowResolver>();
|
||||
}
|
||||
|
||||
public void UseClient(ServiceProvider serviceProvider, FileConfig config)
|
||||
|
@@ -50,7 +50,7 @@ namespace linker.plugins.messenger
|
||||
}
|
||||
}
|
||||
|
||||
public async Task Resolve(Socket socket)
|
||||
public async Task Resolve(Socket socket, Memory<byte> memory)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -54,7 +54,7 @@ namespace linker.plugins.relay
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
public async Task Resolve(Socket socket)
|
||||
public async Task Resolve(Socket socket, Memory<byte> memory)
|
||||
{
|
||||
byte[] buffer = ArrayPool<byte>.Shared.Rent(1024);
|
||||
try
|
||||
|
@@ -8,12 +8,15 @@ namespace linker.plugins.resolver
|
||||
External = 0,
|
||||
Messenger = 1,
|
||||
Relay = 2,
|
||||
Socks4 = 4,
|
||||
Socks5 = 5,
|
||||
Flow = 6,
|
||||
}
|
||||
public interface IResolver
|
||||
{
|
||||
public ResolverType Type { get; }
|
||||
public Task Resolve(Socket socket);
|
||||
public Task Resolve(Socket socket,IPEndPoint ep,Memory<byte> memory);
|
||||
public Task Resolve(Socket socket, Memory<byte> memory);
|
||||
public Task Resolve(Socket socket, IPEndPoint ep, Memory<byte> memory);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -4,6 +4,7 @@ using linker.libs.extends;
|
||||
using System.Buffers;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Net;
|
||||
using System;
|
||||
|
||||
namespace linker.plugins.resolver
|
||||
{
|
||||
@@ -37,12 +38,12 @@ namespace linker.plugins.resolver
|
||||
}
|
||||
socket.KeepAlive();
|
||||
|
||||
await socket.ReceiveAsync(buffer.AsMemory(0, 1), SocketFlags.None).ConfigureAwait(false);
|
||||
int length = await socket.ReceiveAsync(buffer.AsMemory(0, 1), SocketFlags.None).ConfigureAwait(false);
|
||||
ResolverType type = (ResolverType)buffer[0];
|
||||
|
||||
if (resolvers.TryGetValue(type, out IResolver resolver))
|
||||
{
|
||||
await resolver.Resolve(socket);
|
||||
await resolver.Resolve(socket, buffer.AsMemory(0, length));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@@ -10,7 +10,7 @@ namespace linker.plugins.tunnel
|
||||
/// <summary>
|
||||
/// 外网端口处理器
|
||||
/// </summary>
|
||||
public sealed class ExternalResolver : IResolver,IFlow
|
||||
public sealed class ExternalResolver : IResolver, IFlow
|
||||
{
|
||||
public ulong ReceiveBytes { get; private set; }
|
||||
public ulong SendtBytes { get; private set; }
|
||||
@@ -52,18 +52,17 @@ namespace linker.plugins.tunnel
|
||||
/// </summary>
|
||||
/// <param name="socket"></param>
|
||||
/// <returns></returns>
|
||||
public async Task Resolve(Socket socket)
|
||||
public async Task Resolve(Socket socket, Memory<byte> memory)
|
||||
{
|
||||
byte[] sendData = ArrayPool<byte>.Shared.Rent(20);
|
||||
try
|
||||
{
|
||||
Memory<byte> memory = BuildSendData(sendData, socket.RemoteEndPoint as IPEndPoint);
|
||||
memory = BuildSendData(sendData, socket.RemoteEndPoint as IPEndPoint);
|
||||
SendtBytes += (ulong)memory.Length;
|
||||
await socket.SendAsync(memory, SocketFlags.None).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -22,7 +22,7 @@ do
|
||||
then
|
||||
rr=linux-${r}
|
||||
fi
|
||||
dotnet publish ./${f} -c release -f net8.0 -o ./public/publish/docker/linux-${p}-${r}/${f} -r ${rr} --self-contained true -p:TieredPGO=true -p:DebugType=none -p:DebugSymbols=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableCompressionInSingleFile=true -p:DebuggerSupport=false -p:EnableUnsafeBinaryFormatterSerialization=false -p:EnableUnsafeUTF7Encoding=false -p:HttpActivityPropagationSupport=false -p:InvariantGlobalization=true -p:MetadataUpdaterSupport=false -p:UseSystemResourceKeys=true -p:TrimMode=partial
|
||||
dotnet publish ./${f} -c release -f net8.0 -o ./public/publish/docker/linux-${p}-${r}/${f} -r ${rr} --self-contained true -p:TieredPGO=true -p:DebugType=none -p:DebugSymbols=false -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:DebuggerSupport=false -p:EnableUnsafeBinaryFormatterSerialization=false -p:EnableUnsafeUTF7Encoding=false -p:HttpActivityPropagationSupport=false -p:InvariantGlobalization=true -p:MetadataUpdaterSupport=false -p:UseSystemResourceKeys=true -p:TrimMode=partial
|
||||
cp -rf linker/Dockerfile-${p} public/publish/docker/linux-${p}-${r}/${f}/Dockerfile-${p}
|
||||
cp -rf public/extends/any/web public/publish/docker/linux-${p}-${r}/${f}/web
|
||||
mkdir -p public/publish/docker/linux-${p}-${r}/${f}/configs
|
||||
|
@@ -25,7 +25,7 @@ for %%r in (win-x86,win-x64,win-arm64) do (
|
||||
|
||||
for %%r in (win-x86,win-x64,win-arm64,linux-x64,linux-arm,linux-arm64,linux-musl-x64,linux-musl-arm,linux-musl-arm64,osx-x64,osx-arm64) do (
|
||||
|
||||
dotnet publish ./linker -c release -f net8.0 -o ./public/publish/%%r/linker-%%r -r %%r -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true -p:TrimMode=partial -p:TieredPGO=true -p:DebugType=none -p:DebugSymbols=false -p:EnableCompressionInSingleFile=true -p:DebuggerSupport=false -p:EnableUnsafeBinaryFormatterSerialization=false -p:EnableUnsafeUTF7Encoding=false -p:HttpActivityPropagationSupport=false -p:InvariantGlobalization=true -p:MetadataUpdaterSupport=false -p:UseSystemResourceKeys=true
|
||||
dotnet publish ./linker -c release -f net8.0 -o ./public/publish/%%r/linker-%%r -r %%r -p:PublishSingleFile=true --self-contained true -p:TrimMode=partial -p:TieredPGO=true -p:DebugType=none -p:DebugSymbols=false -p:EnableCompressionInSingleFile=true -p:DebuggerSupport=false -p:EnableUnsafeBinaryFormatterSerialization=false -p:EnableUnsafeUTF7Encoding=false -p:HttpActivityPropagationSupport=false -p:InvariantGlobalization=true -p:MetadataUpdaterSupport=false -p:UseSystemResourceKeys=true
|
||||
echo F|xcopy "public\\extends\\%%r\\linker-%%r\\*" "public\\publish\\%%r\\linker-%%r\\*" /s /f /h /y
|
||||
|
||||
echo F|xcopy "public\\extends\\any\\*" "public\\publish\\%%r\\linker-%%r\\*" /s /f /h /y
|
||||
|
@@ -1,3 +1,5 @@
|
||||
v1.4.8
|
||||
2024-10-10 22:17:27
|
||||
v1.4.9
|
||||
2024-10-11 14:25:56
|
||||
1. 使用原生成器替代反射
|
||||
2. 统计所有服务端,客户端数量
|
||||
3. 测试中,请勿更新,请勿更新,请勿更新
|
Reference in New Issue
Block a user