mirror of
https://github.com/snltty/linker.git
synced 2025-10-12 20:40:19 +08:00
流量统计
This commit is contained in:
@@ -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.120" ProductVersion="0.0.0.120" 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.121" ProductVersion="0.0.0.121" 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"/>
|
||||
|
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
1
linker.tray.win/web/css/523.748485d4.css
Normal file
1
linker.tray.win/web/css/523.748485d4.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
linker.tray.win/web/img/anquan.5f8d5e47.svg
Normal file
1
linker.tray.win/web/img/anquan.5f8d5e47.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727193498694" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="153852" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><path d="M1023.910943 511.999898c5.11911 317.794367-194.116663 516.825376-511.91103 511.911029-317.794367 4.914346-516.825376-194.116663-511.91103-511.911029C-4.825463 194.20553 194.205546-4.825478 511.999913 0.088868c317.794367-4.914346 516.825376 194.116663 511.91103 511.91103z" fill="#4ED89D" p-id="153853"></path><path d="M1022.477592 566.671996C1006.915497 340.40732 852.318366 201.16752 614.382119 204.85328c-254.112635-4.095288-413.624112 155.416189-409.528824 409.528824-3.890524 237.936247 135.554041 392.533378 361.613952 408.095473 268.036615-16.381153 439.629192-187.97373 456.010345-455.805581z" fill="#44D39C" p-id="153854"></path><path d="M1015.515602 629.944199C985.824762 491.523456 876.480566 407.160519 716.764325 409.617692c-190.635668-3.071466-310.218084 116.51095-307.146618 307.146618-2.457173 159.716241 81.905765 269.060437 220.121743 298.751277 211.112109-34.400421 351.375731-174.664043 385.776152-385.571388z" fill="#3ACC97" p-id="153855"></path><path d="M997.701098 705.707031C964.734028 646.734881 902.076118 613.153517 819.146531 614.382104c-127.1587-2.047644-206.812056 77.605712-204.764412 204.764412-1.433351 82.929587 32.352777 145.587497 91.120163 178.554567a431.233852 431.233852 0 0 0 292.198816-291.994052z" fill="#30C694" p-id="153856"></path><path d="M604.962956 781.674628l-81.905765 54.467334a20.476441 20.476441 0 0 1-22.728849 0l-81.905765-54.467334a373.285523 373.285523 0 0 1-163.81153-275.20337l-18.428797-193.502369a61.429324 61.429324 0 0 1 44.229113-64.910318l214.797868-61.429324a61.429324 61.429324 0 0 1 33.786128 0l214.797868 61.429324a61.429324 61.429324 0 0 1 44.229113 64.910318l-18.428797 193.502369a373.285523 373.285523 0 0 1-164.630587 275.20337z" fill="#BDEFD1" p-id="153857"></path><path d="M483.128131 593.905662a30.714662 30.714662 0 0 1-21.705028-9.009634l-86.82011-86.82011a30.714662 30.714662 0 0 1 43.410055-43.410056l65.115083 65.115083 122.858647-122.858647a30.714662 30.714662 0 0 1 43.410055 43.410055l-144.563674 145.382733a30.714662 30.714662 0 0 1-21.705028 8.190576z" fill="#FFFFFF" p-id="153858"></path></svg>
|
After Width: | Height: | Size: 2.4 KiB |
1
linker.tray.win/web/img/dadong.e6fd78bf.svg
Normal file
1
linker.tray.win/web/img/dadong.e6fd78bf.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727193611603" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="160189" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><path d="M0 0m435.2 0l153.6 0q435.2 0 435.2 435.2l0 153.6q0 435.2-435.2 435.2l-153.6 0q-435.2 0-435.2-435.2l0-153.6q0-435.2 435.2-435.2Z" fill="#1296db" p-id="160190" data-spm-anchor-id="a313x.search_index.0.i26.1c553a81zI5OvT" class=""></path><path d="M512 243.2c-141.3248 0-256.96 115.968-256.96 257.728v270.592l149.0304-159.7824v-90.2016c0-61.8496 48.832-110.8224 110.5024-110.8224s110.4896 48.9728 110.4896 110.8224v90.2016l149.0432 159.7952V500.928C768.96 359.168 653.312 243.2 512 243.2zM310.656 780.8h389.2992l-114.2016-148.3008h-160.896L310.656 780.8z m180.224-148.3008h30.8992l2.048 46.336h-37.0688c2.0608 0 4.1216-46.336 4.1216-46.336z m-8.7552 74.1504h46.3488l4.6336 46.336h-55.616l4.6336-46.336z" fill="#FFFFFF" p-id="160191"></path></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
linker.tray.win/web/img/fuwuqi.247f2561.svg
Normal file
1
linker.tray.win/web/img/fuwuqi.247f2561.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727193027445" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="105724" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><path d="M0 0m512 0l0 0q512 0 512 512l0 0q0 512-512 512l0 0q-512 0-512-512l0 0q0-512 512-512Z" fill="#818BA4" p-id="105725" data-spm-anchor-id="a313x.search_index.0.i18.1c553a81zI5OvT" class=""></path><path d="M800 617.472L752.128 288.8A75.936 75.936 0 0 0 677.312 224H346.72a76.096 76.096 0 0 0-74.88 64.736L224 618.144v106.112A75.68 75.68 0 0 0 299.68 800h424.576A75.936 75.936 0 0 0 800 724.256v-106.784z m-46.144-4.16H270.336l46.208-318.016a30.528 30.528 0 0 1 30.176-26.176h330.528c15.168 0 28.032 11.168 30.24 26.176l46.368 318.016zM269.12 658.432H754.88v65.92a30.592 30.592 0 0 1-30.528 30.496H299.68a30.592 30.592 0 0 1-30.528-30.528v-65.888z m442.496 25.728h-45.184v44.96h45.12V684.16h0.064z m-115.936 0h45.056v45.12h-45.184v-45.12h0.128z m-283.136 0h44.96v45.12H312.48v-45.12h0.096z m70.688 0h45.12v45.12h-45.12v-45.12z m141.568 0h45.12v45.12h-45.12v-45.12z m-70.72 0H499.2v45.12H454.08v-45.12h0.064z m158.816-276.48h-67.296l-7.456-44.928h47.68l-73.28-56-73.12 56h47.712l-8.768 44.928h-67.264v-33.696l-67.264 56.096 67.264 44.8v-33.6h67.264v67.296h-67.264l100.864 67.2 100.864-67.232h-67.232v-67.232h67.232v33.6l67.264-44.8-67.264-56.128v33.696h0.064z" fill="#FFFFFF" p-id="105726"></path></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
linker.tray.win/web/img/rizhi.c3ca751b.svg
Normal file
1
linker.tray.win/web/img/rizhi.c3ca751b.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727194041488" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="189976" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><path d="M64.67 512c2.03-148.27 27.78-271.04 103.07-344.26C240.96 92.45 363.73 66.7 512 64.67c148.27 2.03 271.04 27.78 344.26 103.07C931.55 240.96 957.3 363.73 959.33 512c-2.03 148.27-27.78 271.04-103.07 344.26C783.04 931.55 660.27 957.3 512 959.33c-148.27-2.03-271.04-27.78-344.26-103.07C92.45 783.04 66.7 660.27 64.67 512z" fill="#9d9237" p-id="189977" data-spm-anchor-id="a313x.search_index.0.i42.1c553a81zI5OvT" class="selected"></path><path d="M710.38 679.44v-61.48c0-11.97-9.71-21.68-21.68-21.68h-54.98c-29.71 0-53.8 24.09-53.8 53.8v61.48c0 11.97 9.71 21.68 21.68 21.68h54.98c29.71 0 53.8-24.09 53.8-53.8z" fill="#FFFFFF" p-id="189978"></path><path d="M633.72 564.01h46.92c16.43 0 29.74-13.32 29.74-29.74V344.56c0-29.71-24.09-53.8-53.8-53.8H367.42c-29.71 0-53.8 24.09-53.8 53.8v334.88c0 29.71 24.09 53.8 53.8 53.8H517.9c16.43 0 29.74-13.32 29.74-29.74v-53.42c0-47.54 38.54-86.07 86.08-86.07zM413.01 372.8h197.98c11.76 0 21.38 7.82 21.38 17.39 0 9.56-9.62 17.39-21.38 17.39H413.01c-11.76 0-21.38-7.82-21.38-17.39 0-9.56 9.62-17.39 21.38-17.39z m0 132.6c-11.76 0-21.38-7.82-21.38-17.39s9.62-17.39 21.38-17.39h197.98c11.76 0 21.38 7.82 21.38 17.39s-9.62 17.39-21.38 17.39H413.01z" fill="#FFFFFF" p-id="189979"></path></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
linker.tray.win/web/img/shouye.4c820c0e.svg
Normal file
1
linker.tray.win/web/img/shouye.4c820c0e.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1727194251404" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="214297" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><path d="M51.2 512c2.048-152.7808 28.672-279.2448 106.1888-354.6112C232.7552 79.7696 359.3216 53.248 512 51.2c152.7808 2.048 279.2448 28.5696 354.6112 106.1888C944.2304 232.7552 970.752 359.2192 972.8 512c-2.048 152.7808-28.5696 279.2448-106.1888 354.6112C791.2448 944.2304 664.7808 970.752 512 972.8c-152.7808-2.048-279.2448-28.5696-354.6112-106.1888C79.872 791.2448 53.248 664.7808 51.2 512z" fill="#409EFF" p-id="214298"></path><path d="M713.1136 456.704L553.5744 304.5376c-22.1184-21.0944-61.0304-21.0944-83.1488 0L310.8864 456.704c-9.0112 8.6016-14.0288 19.6608-14.0288 31.1296v200.3968c0 25.9072 24.8832 47.0016 55.6032 47.0016h88.576c16.9984 0 30.72-11.6736 30.72-26.0096v-72.0896c0-16.2816 12.9024-31.1296 31.744-34.4064 25.8048-4.608 48.8448 12.1856 48.8448 33.28v73.216c0 14.336 13.7216 26.0096 30.72 26.0096h88.576c30.72 0 55.6032-20.992 55.6032-47.0016V487.8336c-0.1024-11.4688-5.12-22.528-14.1312-31.1296z" fill="#FFFFFF" p-id="214299"></path></svg>
|
After Width: | Height: | Size: 1.3 KiB |
@@ -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.40147702.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.20107626.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>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
linker.tray.win/web/js/523.5aa42cd3.js
Normal file
1
linker.tray.win/web/js/523.5aa42cd3.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[158],{3991: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"},i={class:"head"},r={class:"body flex-1 relative"},u={class:"status"};function d(e,a,t,d,c,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",i,[(0,n.bF)(g)]),(0,n.Lk)("div",r,[(0,n.bF)(p)]),(0,n.Lk)("div",u,[(0,n.bF)(v,{config:!1})])])])}t(4114);const c=e=>((0,n.Qi)("data-v-213d85ba"),e=e(),(0,n.jt)(),e),o={class:"head-wrap"},g={class:"tools flex"},p=c((()=>(0,n.Lk)("span",{class:"label"},"服务器 ",-1))),v=c((()=>(0,n.Lk)("span",{class:"flex-1"},null,-1))),h={style:{"margin-left":"1rem"}};function f(e,a,t,l,s,i){const r=(0,n.g2)("el-option"),u=(0,n.g2)("el-select"),d=(0,n.g2)("Refresh"),c=(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)(r,{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)(c,null,{default:(0,n.k6)((()=>[(0,n.bF)(d)])),_: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 F=S;const _=e=>((0,n.Qi)("data-v-5052ddc7"),e=e(),(0,n.jt)(),e),x={class:"net-list-wrap flex flex-column absolute"},z={class:"flex-1 scrollbar"},I={class:"flex"},E=_((()=>(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,i){const r=(0,n.g2)("DeviceName"),u=(0,n.g2)("UpdaterBtn"),d=(0,n.g2)("TuntapShow"),c=(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)(r,{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)(d,{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)(c,{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),H=t(886),N=t(3630),U={components:{StarFilled:b.BQ2,UpdaterBtn:D.A,DeviceName:H.A,TuntapShow:N.A},setup(e){(0,k.B)();const a=(0,m.Kh)({}),{devices:t,machineId:l,_getSignList:s,_getSignList1:i,handleDeviceEdit:r,handlePageChange:u,handlePageSizeChange:d,handleDel:c,clearDevicesTimeout:o}=(0,X.r)(),{tuntap:g,_getTuntapInfo:p,handleTuntapRefresh:v,clearTuntapTimeout:h,handleTuntapEdit:f,sortTuntapIP:b}=(0,y.O)(),{_getUpdater:C,clearUpdaterTimeout:L}=(0,R.d)();return(0,n.sV)((()=>{u(),v(),s(),i(),p(),C()})),(0,n.hi)((()=>{o(),h(),L()})),{state:a,devices:t,machineId:l,handlePageChange:u,handlePageSizeChange:d,tuntap:g}}};const V=(0,w.A)(U,[["render",P],["__scopeId","data-v-5052ddc7"]]);var K=V,Q=t(3179),W=t(1387),j={components:{Head:F,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",d],["__scopeId","data-v-6a3f3b43"]]);var M=q}}]);
|
||||
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[689],{3991: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"},i={class:"head"},r={class:"body flex-1 relative"},u={class:"status"};function d(e,a,t,d,c,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",i,[(0,n.bF)(g)]),(0,n.Lk)("div",r,[(0,n.bF)(p)]),(0,n.Lk)("div",u,[(0,n.bF)(v,{config:!1})])])])}t(4114);const c=e=>((0,n.Qi)("data-v-213d85ba"),e=e(),(0,n.jt)(),e),o={class:"head-wrap"},g={class:"tools flex"},p=c((()=>(0,n.Lk)("span",{class:"label"},"服务器 ",-1))),v=c((()=>(0,n.Lk)("span",{class:"flex-1"},null,-1))),h={style:{"margin-left":"1rem"}};function f(e,a,t,l,s,i){const r=(0,n.g2)("el-option"),u=(0,n.g2)("el-select"),d=(0,n.g2)("Refresh"),c=(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)(r,{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)(c,null,{default:(0,n.k6)((()=>[(0,n.bF)(d)])),_: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 F=S;const _=e=>((0,n.Qi)("data-v-5052ddc7"),e=e(),(0,n.jt)(),e),x={class:"net-list-wrap flex flex-column absolute"},z={class:"flex-1 scrollbar"},I={class:"flex"},E=_((()=>(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,i){const r=(0,n.g2)("DeviceName"),u=(0,n.g2)("UpdaterBtn"),d=(0,n.g2)("TuntapShow"),c=(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)(r,{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)(d,{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)(c,{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),H=t(886),N=t(3630),U={components:{StarFilled:b.BQ2,UpdaterBtn:D.A,DeviceName:H.A,TuntapShow:N.A},setup(e){(0,k.B)();const a=(0,m.Kh)({}),{devices:t,machineId:l,_getSignList:s,_getSignList1:i,handleDeviceEdit:r,handlePageChange:u,handlePageSizeChange:d,handleDel:c,clearDevicesTimeout:o}=(0,X.r)(),{tuntap:g,_getTuntapInfo:p,handleTuntapRefresh:v,clearTuntapTimeout:h,handleTuntapEdit:f,sortTuntapIP:b}=(0,y.O)(),{_getUpdater:C,clearUpdaterTimeout:L}=(0,R.d)();return(0,n.sV)((()=>{u(),v(),s(),i(),p(),C()})),(0,n.hi)((()=>{o(),h(),L()})),{state:a,devices:t,machineId:l,handlePageChange:u,handlePageSizeChange:d,tuntap:g}}};const V=(0,w.A)(U,[["render",P],["__scopeId","data-v-5052ddc7"]]);var K=V,Q=t(5153),W=t(1387),j={components:{Head:F,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",d],["__scopeId","data-v-6a3f3b43"]]);var M=q}}]);
|
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
import { sendWebsocketMsg } from './request'
|
||||
|
||||
export const getFlows = () => {
|
||||
return sendWebsocketMsg('serverClient/GetFlows');
|
||||
return sendWebsocketMsg('flowClient/GetFlows');
|
||||
}
|
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getFlows } from '@/apis/server';
|
||||
import { getFlows } from '@/apis/flow';
|
||||
import { onMounted, onUnmounted, reactive } from 'vue';
|
||||
|
||||
export default {
|
||||
@@ -38,9 +38,10 @@ export default {
|
||||
}
|
||||
|
||||
const id2text = {
|
||||
'External':'外网端口(解析器)',
|
||||
'Relay':'中继(解析器+流量)',
|
||||
'Messenger':'信标(解析器)',
|
||||
'External':'外网端口(总计)',
|
||||
'Relay':'中继(总计)',
|
||||
'Messenger':'信标(总计)',
|
||||
'SForward':'内网穿透(总计)',
|
||||
'0':'登入信标',
|
||||
'1':'客户端列表',
|
||||
'2':'客户端删除',
|
||||
|
@@ -5,18 +5,18 @@ using linker.client.config;
|
||||
using linker.plugins.client;
|
||||
using linker.plugins.capi;
|
||||
using linker.plugins.messenger;
|
||||
using linker.plugins.server.messenger;
|
||||
using linker.plugins.flow.messenger;
|
||||
|
||||
namespace linker.plugins.server
|
||||
namespace linker.plugins.flow
|
||||
{
|
||||
public sealed class ServerClientApiController : IApiClientController
|
||||
public sealed class FlowClientApiController : IApiClientController
|
||||
{
|
||||
private readonly MessengerSender messengerSender;
|
||||
private readonly ClientSignInState clientSignInState;
|
||||
private readonly FileConfig config;
|
||||
private readonly RunningConfig runningConfig;
|
||||
|
||||
public ServerClientApiController(MessengerSender messengerSender, ClientSignInState clientSignInState, FileConfig config, RunningConfig runningConfig)
|
||||
public FlowClientApiController(MessengerSender messengerSender, ClientSignInState clientSignInState, FileConfig config, RunningConfig runningConfig)
|
||||
{
|
||||
this.messengerSender = messengerSender;
|
||||
this.clientSignInState = clientSignInState;
|
||||
@@ -24,18 +24,18 @@ namespace linker.plugins.server
|
||||
this.runningConfig = runningConfig;
|
||||
}
|
||||
|
||||
public async Task<ServerFlowInfo> GetFlows(ApiControllerParamsInfo param)
|
||||
public async Task<FlowInfo> GetFlows(ApiControllerParamsInfo param)
|
||||
{
|
||||
MessageResponeInfo resp = await messengerSender.SendReply(new MessageRequestWrap
|
||||
{
|
||||
Connection = clientSignInState.Connection,
|
||||
MessengerId = (ushort)ServerMessengerIds.Flow,
|
||||
MessengerId = (ushort)FlowMessengerIds.List,
|
||||
});
|
||||
if (resp.Code == MessageResponeCodes.OK && resp.Data.Length > 0)
|
||||
{
|
||||
return MemoryPackSerializer.Deserialize<ServerFlowInfo>(resp.Data.Span);
|
||||
return MemoryPackSerializer.Deserialize<FlowInfo>(resp.Data.Span);
|
||||
}
|
||||
return new ServerFlowInfo();
|
||||
return new FlowInfo();
|
||||
}
|
||||
|
||||
}
|
41
linker/plugins/flow/FlowStartup.cs
Normal file
41
linker/plugins/flow/FlowStartup.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using linker.config;
|
||||
using linker.plugins.flow.messenger;
|
||||
using linker.startup;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Reflection;
|
||||
|
||||
namespace linker.plugins.flow
|
||||
{
|
||||
public sealed class FlowStartup : IStartup
|
||||
{
|
||||
public StartupLevel Level => StartupLevel.Normal;
|
||||
public string Name => "flow";
|
||||
public bool Required => false;
|
||||
public string[] Dependent => new string[] { };
|
||||
public StartupLoadType LoadType => StartupLoadType.Dependent;
|
||||
|
||||
public void AddClient(ServiceCollection serviceCollection, FileConfig config, Assembly[] assemblies)
|
||||
{
|
||||
serviceCollection.AddSingleton<FlowClientApiController>();
|
||||
serviceCollection.AddSingleton<FlowTransfer>();
|
||||
}
|
||||
|
||||
public void AddServer(ServiceCollection serviceCollection, FileConfig config, Assembly[] assemblies)
|
||||
{
|
||||
serviceCollection.AddSingleton<FlowMessenger>();
|
||||
serviceCollection.AddSingleton<FlowTransfer>();
|
||||
}
|
||||
|
||||
public void UseClient(ServiceProvider serviceProvider, FileConfig config, Assembly[] assemblies)
|
||||
{
|
||||
FlowTransfer flowTransfer = serviceProvider.GetService<FlowTransfer>();
|
||||
flowTransfer.LoadFlows(assemblies);
|
||||
}
|
||||
|
||||
public void UseServer(ServiceProvider serviceProvider, FileConfig config, Assembly[] assemblies)
|
||||
{
|
||||
FlowTransfer flowTransfer = serviceProvider.GetService<FlowTransfer>();
|
||||
flowTransfer.LoadFlows(assemblies);
|
||||
}
|
||||
}
|
||||
}
|
26
linker/plugins/flow/FlowTransfer.cs
Normal file
26
linker/plugins/flow/FlowTransfer.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using linker.libs;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Reflection;
|
||||
namespace linker.plugins.flow
|
||||
{
|
||||
public sealed class FlowTransfer
|
||||
{
|
||||
private List<IFlow> flows = new List<IFlow>();
|
||||
|
||||
private readonly ServiceProvider serviceProvider;
|
||||
public FlowTransfer(ServiceProvider serviceProvider)
|
||||
{
|
||||
this.serviceProvider = serviceProvider;
|
||||
}
|
||||
public void LoadFlows(Assembly[] assemblys)
|
||||
{
|
||||
var types = ReflectionHelper.GetInterfaceSchieves(assemblys, typeof(IFlow)).Distinct();
|
||||
flows = types.Select(c=> (IFlow)serviceProvider.GetService(c)).Where(c=>c != null).ToList();
|
||||
}
|
||||
|
||||
public Dictionary<string, FlowItemInfo> GetFlows()
|
||||
{
|
||||
return flows.Select(c => new FlowItemInfo { ReceiveBytes = c.ReceiveBytes, SendtBytes = c.SendtBytes, FlowName = c.FlowName }).ToDictionary(c => c.FlowName);
|
||||
}
|
||||
}
|
||||
}
|
33
linker/plugins/flow/IFlow.cs
Normal file
33
linker/plugins/flow/IFlow.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using MemoryPack;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace linker.plugins.flow
|
||||
{
|
||||
public interface IFlow
|
||||
{
|
||||
public ulong ReceiveBytes { get; }
|
||||
public ulong SendtBytes { get; }
|
||||
public string FlowName { get; }
|
||||
}
|
||||
|
||||
[MemoryPackable]
|
||||
public sealed partial class FlowItemInfo
|
||||
{
|
||||
public ulong ReceiveBytes { get; set; }
|
||||
public ulong SendtBytes { get; set; }
|
||||
|
||||
[MemoryPackIgnore, JsonIgnore]
|
||||
public string FlowName { get; set; }
|
||||
}
|
||||
|
||||
[MemoryPackable]
|
||||
public sealed partial class FlowInfo
|
||||
{
|
||||
public Dictionary<string, FlowItemInfo> Resolvers { get; set; }
|
||||
public Dictionary<ushort, FlowItemInfo> Messangers { get; set; }
|
||||
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime Now { get; set; }
|
||||
}
|
||||
}
|
||||
|
34
linker/plugins/flow/messenger/FlowMessenger.cs
Normal file
34
linker/plugins/flow/messenger/FlowMessenger.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using linker.plugins.messenger;
|
||||
using MemoryPack;
|
||||
|
||||
namespace linker.plugins.flow.messenger
|
||||
{
|
||||
public sealed class FlowMessenger : IMessenger
|
||||
{
|
||||
private readonly MessengerResolver messengerResolver;
|
||||
private readonly FlowTransfer flowTransfer;
|
||||
|
||||
private DateTime start = DateTime.Now;
|
||||
|
||||
public FlowMessenger(MessengerResolver messengerResolver, FlowTransfer flowTransfer)
|
||||
{
|
||||
this.messengerResolver = messengerResolver;
|
||||
this.flowTransfer = flowTransfer;
|
||||
}
|
||||
|
||||
[MessengerId((ushort)FlowMessengerIds.List)]
|
||||
public void List(IConnection connection)
|
||||
{
|
||||
FlowInfo serverFlowInfo = new FlowInfo
|
||||
{
|
||||
Messangers = messengerResolver.GetFlows(),
|
||||
Resolvers = flowTransfer.GetFlows(),
|
||||
Start = start,
|
||||
Now = DateTime.Now,
|
||||
};
|
||||
connection.Write(MemoryPackSerializer.Serialize(serverFlowInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
11
linker/plugins/flow/messenger/FlowMessengerIds.cs
Normal file
11
linker/plugins/flow/messenger/FlowMessengerIds.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace linker.plugins.flow.messenger
|
||||
{
|
||||
public enum FlowMessengerIds : ushort
|
||||
{
|
||||
Min = 2700,
|
||||
|
||||
List = 2701,
|
||||
|
||||
Max = 2799
|
||||
}
|
||||
}
|
@@ -9,13 +9,14 @@ using System.Security.Cryptography.X509Certificates;
|
||||
using linker.libs.extends;
|
||||
using linker.plugins.resolver;
|
||||
using MemoryPack;
|
||||
using linker.plugins.flow;
|
||||
|
||||
namespace linker.plugins.messenger
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息处理总线
|
||||
/// </summary>
|
||||
public sealed class MessengerResolver : IConnectionReceiveCallback, IResolver
|
||||
public sealed class MessengerResolver : IConnectionReceiveCallback, IResolver, IFlow
|
||||
{
|
||||
public ResolverType Type => ResolverType.Messenger;
|
||||
|
||||
@@ -29,7 +30,8 @@ namespace linker.plugins.messenger
|
||||
|
||||
public ulong ReceiveBytes { get; private set; }
|
||||
public ulong SendtBytes { get; private set; }
|
||||
private Dictionary<ushort, MessengerFlowItemInfo> messangerFlows { get; } = new Dictionary<ushort, MessengerFlowItemInfo>();
|
||||
public string FlowName => "Messenger";
|
||||
private Dictionary<ushort, FlowItemInfo> messangerFlows { get; } = new Dictionary<ushort, FlowItemInfo>();
|
||||
|
||||
|
||||
|
||||
@@ -161,7 +163,7 @@ namespace linker.plugins.messenger
|
||||
}
|
||||
messengers.TryAdd(mid.Id, cache);
|
||||
|
||||
messangerFlows.TryAdd(mid.Id, new MessengerFlowItemInfo { });
|
||||
messangerFlows.TryAdd(mid.Id, new FlowItemInfo { });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -213,7 +215,7 @@ namespace linker.plugins.messenger
|
||||
}
|
||||
|
||||
//流量统计
|
||||
if (messangerFlows.TryGetValue(requestWrap.MessengerId, out MessengerFlowItemInfo messengerFlowItemInfo))
|
||||
if (messangerFlows.TryGetValue(requestWrap.MessengerId, out FlowItemInfo messengerFlowItemInfo))
|
||||
{
|
||||
ReceiveBytes += (ulong)data.Length;
|
||||
messengerFlowItemInfo.ReceiveBytes += (ulong)data.Length;
|
||||
@@ -255,7 +257,7 @@ namespace linker.plugins.messenger
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<ushort, MessengerFlowItemInfo> GetFlows()
|
||||
public Dictionary<ushort, FlowItemInfo> GetFlows()
|
||||
{
|
||||
return messangerFlows;
|
||||
}
|
||||
|
@@ -4,17 +4,19 @@ using linker.libs.extends;
|
||||
using System.Collections.Concurrent;
|
||||
using linker.plugins.resolver;
|
||||
using System.Net;
|
||||
using linker.plugins.flow;
|
||||
|
||||
namespace linker.plugins.relay
|
||||
{
|
||||
/// <summary>
|
||||
/// 中继连接处理
|
||||
/// </summary>
|
||||
public sealed class RelayResolver : IResolver
|
||||
public sealed class RelayResolver : IResolver,IFlow
|
||||
{
|
||||
public ResolverType Type => ResolverType.Relay;
|
||||
public ulong ReceiveBytes { get; private set; }
|
||||
public ulong SendtBytes { get; private set; }
|
||||
public string FlowName => "Relay";
|
||||
|
||||
public RelayResolver()
|
||||
{
|
||||
@@ -127,7 +129,6 @@ namespace linker.plugins.relay
|
||||
Answer = 1,
|
||||
}
|
||||
|
||||
|
||||
public sealed class RelayWrap
|
||||
{
|
||||
public ulong FlowId { get; set; }
|
||||
|
@@ -1,5 +1,4 @@
|
||||
using MemoryPack;
|
||||
using System.Net;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace linker.plugins.resolver
|
||||
@@ -12,18 +11,10 @@ namespace linker.plugins.resolver
|
||||
}
|
||||
public interface IResolver
|
||||
{
|
||||
public ulong ReceiveBytes { get; }
|
||||
public ulong SendtBytes { get;}
|
||||
|
||||
public ResolverType Type { get; }
|
||||
public Task Resolve(Socket socket);
|
||||
public Task Resolve(Socket socket,IPEndPoint ep,Memory<byte> memory);
|
||||
}
|
||||
|
||||
[MemoryPackable]
|
||||
public sealed partial class ResolverFlowItemInfo
|
||||
{
|
||||
public ulong ReceiveBytes { get; set; }
|
||||
public ulong SendtBytes { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -69,10 +69,5 @@ namespace linker.plugins.resolver
|
||||
await resolver.Resolve(socket, ep, memory);
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<string, ResolverFlowItemInfo> GetFlows()
|
||||
{
|
||||
return resolvers.Values.ToDictionary(c => c.Type.ToString(), d => new ResolverFlowItemInfo { ReceiveBytes=d.ReceiveBytes, SendtBytes=d.SendtBytes });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,6 @@ using linker.startup;
|
||||
using linker.libs;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Reflection;
|
||||
using linker.plugins.server.messenger;
|
||||
|
||||
namespace linker.plugins.server
|
||||
{
|
||||
@@ -15,18 +14,16 @@ namespace linker.plugins.server
|
||||
public StartupLevel Level => StartupLevel.Normal;
|
||||
public string Name => "server";
|
||||
public bool Required => true;
|
||||
public string[] Dependent => new string[] {"messenger", "serialize", "firewall", "signin", "config", "resolver" };
|
||||
public string[] Dependent => new string[] {"messenger", "serialize", "firewall", "signin", "config"};
|
||||
public StartupLoadType LoadType => StartupLoadType.Normal;
|
||||
|
||||
public void AddClient(ServiceCollection serviceCollection, FileConfig config, Assembly[] assemblies)
|
||||
{
|
||||
serviceCollection.AddSingleton<ServerClientApiController>();
|
||||
}
|
||||
|
||||
public void AddServer(ServiceCollection serviceCollection, FileConfig config, Assembly[] assemblies)
|
||||
{
|
||||
serviceCollection.AddSingleton<TcpServer>();
|
||||
serviceCollection.AddSingleton<ServerMessenger>();
|
||||
}
|
||||
|
||||
public void UseClient(ServiceProvider serviceProvider, FileConfig config, Assembly[] assemblies)
|
||||
|
@@ -1,10 +1,4 @@
|
||||
using linker.libs.extends;
|
||||
using linker.plugins.messenger;
|
||||
using linker.plugins.resolver;
|
||||
using MemoryPack;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net;
|
||||
|
||||
namespace linker.config
|
||||
{
|
||||
public sealed partial class ConfigInfo
|
||||
@@ -27,17 +21,4 @@ namespace linker.config
|
||||
return obj.ToJsonFormat();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[MemoryPackable]
|
||||
public sealed partial class ServerFlowInfo
|
||||
{
|
||||
public Dictionary<string, ResolverFlowItemInfo> Resolvers { get; set; }
|
||||
public Dictionary<ushort, MessengerFlowItemInfo> Messangers { get; set; }
|
||||
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime Now { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,36 +0,0 @@
|
||||
using linker.config;
|
||||
using linker.plugins.messenger;
|
||||
using linker.plugins.resolver;
|
||||
using MemoryPack;
|
||||
|
||||
namespace linker.plugins.server.messenger
|
||||
{
|
||||
public sealed class ServerMessenger : IMessenger
|
||||
{
|
||||
private readonly MessengerResolver messengerResolver;
|
||||
private readonly ResolverTransfer resolverTransfer;
|
||||
|
||||
private DateTime start = DateTime.Now;
|
||||
|
||||
public ServerMessenger(MessengerResolver messengerResolver, ResolverTransfer resolverTransfer)
|
||||
{
|
||||
this.messengerResolver = messengerResolver;
|
||||
this.resolverTransfer = resolverTransfer;
|
||||
}
|
||||
|
||||
[MessengerId((ushort)ServerMessengerIds.Flow)]
|
||||
public void Flow(IConnection connection)
|
||||
{
|
||||
ServerFlowInfo serverFlowInfo = new ServerFlowInfo
|
||||
{
|
||||
Messangers = messengerResolver.GetFlows(),
|
||||
Resolvers = resolverTransfer.GetFlows(),
|
||||
Start = start,
|
||||
Now = DateTime.Now,
|
||||
};
|
||||
connection.Write(MemoryPackSerializer.Serialize(serverFlowInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
namespace linker.plugins.server.messenger
|
||||
{
|
||||
public enum ServerMessengerIds : ushort
|
||||
{
|
||||
Min = 2700,
|
||||
|
||||
Flow = 2701,
|
||||
|
||||
Max = 2799
|
||||
}
|
||||
}
|
@@ -1,10 +1,16 @@
|
||||
using linker.libs;
|
||||
using linker.plugins.flow;
|
||||
using System.Text;
|
||||
|
||||
namespace linker.plugins.sforward.proxy
|
||||
{
|
||||
public partial class SForwardProxy
|
||||
public partial class SForwardProxy:IFlow
|
||||
{
|
||||
public ulong ReceiveBytes { get; private set; }
|
||||
public ulong SendtBytes { get; private set; }
|
||||
public string FlowName => "SForward";
|
||||
|
||||
|
||||
private readonly NumberSpace ns = new NumberSpace();
|
||||
private byte[] flagBytes = Encoding.UTF8.GetBytes($"snltty.sforward");
|
||||
|
||||
@@ -13,6 +19,8 @@ namespace linker.plugins.sforward.proxy
|
||||
UdpTask();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string Start(int port, bool isweb,byte bufferSize)
|
||||
{
|
||||
try
|
||||
|
@@ -268,6 +268,7 @@ namespace linker.plugins.sforward.proxy
|
||||
/// <param name="buffer"></param>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="target"></param>
|
||||
/// <param name="receive"></param>
|
||||
/// <returns></returns>
|
||||
private async Task CopyToAsync(Memory<byte> buffer, Socket source, Socket target)
|
||||
{
|
||||
@@ -276,6 +277,8 @@ namespace linker.plugins.sforward.proxy
|
||||
int bytesRead;
|
||||
while ((bytesRead = await source.ReceiveAsync(buffer, SocketFlags.None).ConfigureAwait(false)) != 0)
|
||||
{
|
||||
ReceiveBytes += (ulong)bytesRead;
|
||||
SendtBytes += (ulong)bytesRead;
|
||||
await target.SendAsync(buffer.Slice(0, bytesRead), SocketFlags.None).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using linker.libs;
|
||||
using linker.libs.extends;
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net;
|
||||
@@ -47,12 +48,15 @@ namespace linker.plugins.sforward.proxy
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Memory<byte> memory = buffer.AsMemory(0, result.ReceivedBytes);
|
||||
ReceiveBytes += (ulong)memory.Length;
|
||||
|
||||
IPEndPoint source = result.RemoteEndPoint as IPEndPoint;
|
||||
//已经连接
|
||||
if (udpConnections.TryGetValue(source, out UdpTargetCache cache) && cache != null)
|
||||
{
|
||||
SendtBytes += (ulong)memory.Length;
|
||||
cache.Update();
|
||||
await token.SourceSocket.SendToAsync(memory, cache.IPEndPoint).ConfigureAwait(false);
|
||||
}
|
||||
@@ -183,6 +187,9 @@ namespace linker.plugins.sforward.proxy
|
||||
cache.Update();
|
||||
|
||||
Memory<byte> memory = buffer.AsMemory(0, result.ReceivedBytes);
|
||||
ReceiveBytes += (ulong)memory.Length;
|
||||
SendtBytes += (ulong)memory.Length;
|
||||
|
||||
if (serviceUdp == null)
|
||||
{
|
||||
serviceUdp = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
@@ -208,7 +215,11 @@ namespace linker.plugins.sforward.proxy
|
||||
socketUdp?.Dispose();
|
||||
break;
|
||||
}
|
||||
await socketUdp.SendToAsync(buffer.AsMemory(0, result.ReceivedBytes), server).ConfigureAwait(false);
|
||||
Memory<byte> memory = buffer.AsMemory(0, result.ReceivedBytes);
|
||||
ReceiveBytes += (ulong)memory.Length;
|
||||
SendtBytes += (ulong)memory.Length;
|
||||
|
||||
await socketUdp.SendToAsync(memory, server).ConfigureAwait(false);
|
||||
cache.Update();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -248,7 +259,6 @@ namespace linker.plugins.sforward.proxy
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void UdpTask()
|
||||
{
|
||||
TimerHelper.SetInterval(() =>
|
||||
|
@@ -3,16 +3,19 @@ using System.Net;
|
||||
using System.Buffers;
|
||||
using linker.libs.extends;
|
||||
using linker.plugins.resolver;
|
||||
using linker.plugins.flow;
|
||||
|
||||
namespace linker.plugins.tunnel
|
||||
{
|
||||
/// <summary>
|
||||
/// 外网端口处理器
|
||||
/// </summary>
|
||||
public sealed class ExternalResolver : IResolver
|
||||
public sealed class ExternalResolver : IResolver,IFlow
|
||||
{
|
||||
public ulong ReceiveBytes { get; private set; }
|
||||
public ulong SendtBytes { get; private set; }
|
||||
public string FlowName => "External";
|
||||
|
||||
public ResolverType Type => ResolverType.External;
|
||||
|
||||
public ExternalResolver()
|
||||
|
@@ -1,3 +1,3 @@
|
||||
v1.4.4
|
||||
2024-09-25 00:20:16
|
||||
2024-09-25 10:36:21
|
||||
1. 增加流量统计(暂时显示服务端流量)
|
Reference in New Issue
Block a user