This commit is contained in:
snltty
2024-11-09 15:25:36 +08:00
parent 6daa9de49e
commit 7fda60a128
17 changed files with 59 additions and 29 deletions

View File

@@ -15,6 +15,8 @@ sidebar_position: 2
## 2、多服务器中继节点
:::tip[说明]
在服务端 `configs/server.json` 中(`Relay->Distributed`)下配置
```json
@@ -24,15 +26,23 @@ sidebar_position: 2
//节点ID首次运行会自动生成一个你也可以替换成自己喜欢的
"Id": "EEC9231A-D505-4B65-85F1-CB26181F5196",
//起个你喜欢的名字
"Name": "snltty的服务器",
"Name": "中继节点A",
//本服务器地址 可以是域名IP域名:端口IP:端口
//当MasterHost使用内网地址时你应该填写域名或者本机的外网IP
//当MasterHost使用外网地址或者域名时可以留空给程序自动获取
"Host": "linker.snltty.com:1802",
//最大连接数
"MaxConnection": 100,
//每个连接最大带宽 单位Mbps
//连接最大带宽 Mbps
"MaxBandwidth": 1,
//总最大带宽 Mbps
"MaxBandwidthTotal": 0,
//月流量
"MaxGbTotal": 0,
//剩余流量字节数0即可
"MaxGbTotalLastBytes": 0,
//流量统计月度0即可
"MaxGbTotalMonth": 11,
//是否公开本节点,公开所有人可用,不公开则认证通过可用
"Public": false,

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="linker.tray.win" libEmbed="true" icon="..\linker\favicon.ico" ui="win" output="linker.tray.win.exe" CompanyName="snltty" FileDescription="linker.tray.win" LegalCopyright="Copyright (C) snltty 2024" ProductName="linker.tray.win" InternalName="linker.install.win" FileVersion="0.0.0.159" ProductVersion="0.0.0.159" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<project ver="10" name="linker.tray.win" libEmbed="true" icon="..\linker\favicon.ico" ui="win" output="linker.tray.win.exe" CompanyName="snltty" FileDescription="linker.tray.win" LegalCopyright="Copyright (C) snltty 2024" ProductName="linker.tray.win" InternalName="linker.install.win" FileVersion="0.0.0.160" ProductVersion="0.0.0.160" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
<folder name="资源文件" path="res" embed="true" local="false" ignored="false">
<file name="favicon.ico" path="res\favicon.ico" comment="res\favicon.ico"/>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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.73d25b9a.js"></script><script defer="defer" src="/js/app.7fa66712.js"></script><link href="/css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="/css/app.d3461143.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.73d25b9a.js"></script><script defer="defer" src="/js/app.624a0b75.js"></script><link href="/css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="/css/app.d3461143.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>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[409],{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(4831),U=t(8695),H=t(3460),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(1355),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([[898],{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(4831),U=t(8695),H=t(3460),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(1312),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}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -88,6 +88,7 @@ export default {
};
const _getFlows = ()=>{
getFlows().then(res => {
console.log(res);
const old = state.old || res;
if(res.Items['_']){

View File

@@ -84,8 +84,12 @@ export default {
'2201':'运行网卡(转发)',
'2203':'停止网卡(转发)',
'2205':'更新网卡(转发)',
'2206':'同步网卡(转发)',
'2207':'同步网卡(转发)',
'2208':'配置网卡网络',
'2209':'获取网卡网络',
'2210':'分配IP',
'2211':'网卡变化',
'2212':'网卡变化(转发)',
'2213':'IP续约',
'2301':'添加内网穿透',
'2302':'移除内网穿透',
@@ -96,17 +100,16 @@ export default {
'2401':'测试端口转发(转发)',
'2403':'获取端口转发(转发)',
'2503':'获取权限(转发)',
'2504':'获取权限(转发)',
'2506':'更新权限(转发)',
'2508':'同步密钥(转发)',
'2510':'同步服务器(转发)',
'2507':'同步配置',
'2508':'同步配置(转发)',
'2601':'更新信息(转发)',
'2602':'更新信息(转发)',
'2603':'确认更新(转发)',
'2604':'确认更新(转发)',
'2605':'重启(转发)',
'2606':'重启',
'2607':'服务器更新信息',
'2608':'确认服务器更新',
'2609':'服务器重启',
@@ -117,6 +120,21 @@ export default {
'2702':'服务器信标流量',
'2703':'服务器中继流量',
'2704':'服务器内网穿透流量',
'2807':'同步配置',
'2808':'同步配置(转发)',
'2900':'运行socks5',
'2901':'运行socks5(转发)',
'2902':'停止socks5',
'2903':'停止socks5(转发)',
'2904':'更新socks5',
'2905':'更新socks5(转发)',
'3003':'获取权限',
'3004':'获取权限(转发)',
'3005':'更新权限',
'3006':'更新权限(转发)',
}
const _getMessengerFlows = ()=>{

View File

@@ -2,14 +2,14 @@
{
public enum AccessMessengerIds : ushort
{
Min = 2600,
Min = 3000,
Access = 2603,
AccessForward = 2604,
Access = 3003,
AccessForward = 3004,
AccessUpdate = 2605,
AccessUpdateForward = 2606,
AccessUpdate = 3005,
AccessUpdateForward = 3006,
Max = 2699
Max = 3099
}
}

View File

@@ -55,6 +55,9 @@ namespace linker.plugins.flow
serviceCollection.AddSingleton<SForwardFlow>();
serviceCollection.AddSingleton<SForwardProxy, SForwardProxyFlow>();
serviceCollection.AddSingleton<RelayReportFlow>();
serviceCollection.AddSingleton<RelayReportResolver, RelayReportResolverFlow>();
}
public void UseClient(ServiceProvider serviceProvider, FileConfig config)

View File

@@ -1,6 +1,4 @@
using linker.plugins.messenger;
using linker.plugins.relay;
using linker.plugins.sforward.proxy;
using linker.plugins.signin.messenger;
using MemoryPack;

View File

@@ -96,11 +96,11 @@ namespace linker.plugins.relay.server
.Where(c => Environment.TickCount64 - c.LastTicks < 15000).OrderByDescending(c => c.LastTicks);
return result.OrderByDescending(x => x.MaxConnection == 0 ? int.MaxValue : x.MaxConnection)
.ThenByDescending(x => x.MaxGbTotal == 0 ? double.MaxValue : x.MaxGbTotal)
.ThenByDescending(x => x.MaxGbTotalLastBytes == 0 ? ulong.MaxValue : x.MaxGbTotalLastBytes)
.ThenBy(x => x.ConnectionRatio)
.ThenByDescending(x => x.MaxBandwidth == 0 ? double.MaxValue : x.MaxBandwidth)
.ThenByDescending(x => x.MaxBandwidthTotal == 0 ? double.MaxValue : x.MaxBandwidthTotal)
.ThenBy(x => x.ConnectionRatio)
.ThenByDescending(x => x.MaxGbTotal == 0 ? double.MaxValue : x.MaxGbTotal)
.ThenByDescending(x => x.MaxGbTotalLastBytes == 0 ? ulong.MaxValue : x.MaxGbTotalLastBytes)
.ToList();
}

View File

@@ -1,5 +1,5 @@
v1.5.2
2024-11-09 11:25:31
2024-11-09 15:25:36
1. 多中继节点服务器
2. 修复分组密钥
3. 修复中继线路