mirror of
https://github.com/snltty/linker.git
synced 2025-09-26 21:15:57 +08:00
180
This commit is contained in:
29
README.md
29
README.md
@@ -24,15 +24,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
## ⛔免责声明
|
||||
## [😡]免责声明
|
||||
|
||||
**linker** 基于 [GPL-2.0 License](https://opensource.org/licenses/GPL-2.0) 发布,完全免费提供,旨在“按现状”供用户使用。作者及贡献者不对使用本软件所产生的任何直接或间接后果承担责任,包括但不限于性能下降、数据丢失、服务中断、或任何其他类型的损害。
|
||||
本软件基于 [GPL-2.0 License](https://opensource.org/licenses/GPL-2.0) 发布,完全免费提供,旨在“按现状”供用户使用。作者及贡献者不对使用本软件所产生的任何直接或间接后果承担责任,包括但不限于性能下降、数据丢失、服务中断、或任何其他类型的损害。
|
||||
|
||||
**无任何保证**:本软件不提供任何明示或暗示的保证,包括但不限于对特定用途的适用性、无侵权性、商用性及可靠性的保证。
|
||||
|
||||
**用户责任**:使用本软件即表示您理解并同意承担由此产生的一切风险及责任,使用人员有责任和义务遵守当地法律条规,请勿用于违法犯罪。
|
||||
|
||||
## 🚩大概意思
|
||||
## [😇]大概意思
|
||||
|
||||
使用p2p或者中继转发,让你的各个局域网连通起来,让各个局域网内的任意联网设备都可以相互连通
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<p><img src="./readme/linker.jpg"></p>
|
||||
</div>
|
||||
|
||||
## 💡主要功能
|
||||
## [🤩]主要功能
|
||||
|
||||
##### 私有部署
|
||||
- **私有部署:** 私有部署服务端,信息更安全。
|
||||
@@ -71,28 +71,27 @@
|
||||
- **CDKEY:** 可以临时解锁一些限制,中继,内外穿透什么的,方便你分享服务器给朋友使用。
|
||||
- **使用文档:** 更多功能请阅读<a href="https://linker-doc.snltty.com">使用说明文档</a>
|
||||
|
||||
## ⭐管理页面
|
||||
|
||||
<div align="center">
|
||||
## [😂]管理页面
|
||||
<p><img src="./readme/full.jpg"></p>
|
||||
<p><img src="./readme/plan.jpg"></p>
|
||||
<p><img src="./readme/firewall.jpg"></p>
|
||||
</div>
|
||||
|
||||
## 🤝支持作者
|
||||
## [😍]为爱发电
|
||||
|
||||
若此项目对您有用,您可以考虑通过 **[🔋为爱发电](https://afdian.com/a/snltty)** 赞助一笔小钱支持作者。作者将能有更多的金钱来测试和维护linker,并在项目上投入更多的时间和精力。
|
||||
|
||||
**感谢名单**
|
||||
若此项目对您有用,可以考虑通过 **[🔋为爱发电](https://afdian.com/a/snltty)** 对作者稍加支持,让作者更有动力,在项目上投入更多时间和精力
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>感谢名单</strong></summary>
|
||||
<div>
|
||||
- 米多贝克&米多网络工程
|
||||
- 阳阳
|
||||
|
||||
- 谢幕____(海那边的白月光)
|
||||
- swayer.
|
||||
- 浅浅
|
||||
</div>
|
||||
</details>
|
||||
|
||||
## 🚀特别说明
|
||||
## [😎]特别说明
|
||||
|
||||
本项目已加入 [DotNetGuide](https://github.com/YSGStudyHards/DotNetGuide) 列表。<br/>
|
||||
本项目已加入 [dotNET China](https://gitee.com/dotnetchina) 组织。<br/>
|
||||
|
1
src/linker.app/public/web/css/161.10dae479.css
Normal file
1
src/linker.app/public/web/css/161.10dae479.css
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/css/596.3a82dd0c.css
Normal file
1
src/linker.app/public/web/css/596.3a82dd0c.css
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/css/722.57e7bac3.css
Normal file
1
src/linker.app/public/web/css/722.57e7bac3.css
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/img/dianchi.2949547b.svg
Normal file
1
src/linker.app/public/web/img/dianchi.2949547b.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="1747817053689" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8290" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><path d="M653.3 141.2v-5.5c0-34.1-28.2-61.7-63-61.7H435.7c-34.8 0-63 27.6-63 61.7v5.5c0 10.7-8.9 19.4-19.8 19.4H244.7c-44 0-79.7 34.9-79.7 78v592.5c0 43.1 35.7 78 79.7 78h536.7c44 0 79.7-34.9 79.7-78V238.6c0-43.1-35.7-78-79.7-78H673.1c-10.9 0-19.8-8.7-19.8-19.4z" fill="#0DCEA7" p-id="8291"></path><path d="M645.2 105.4C634.4 86.6 613.9 74 590.3 74H435.7c-16.5 0-31.5 6.2-42.7 16.3 32.4-7.6 66.1-11.6 100.8-11.6 53.2 0 104.2 9.4 151.4 26.7zM861 275v-36.4c0-43.1-35.7-78-79.7-78H750c43.5 31.1 81.2 69.9 111 114.4zM703 909.1h78.4c44 0 79.7-34.9 79.7-78v-65.7C821 825.3 766.7 874.8 703 909.1zM237.1 160.9c-35.5 3.3-64.2 29.3-70.7 63.1 21.2-23.4 45-44.6 70.7-63.1zM165 814.9v16.2c0 43.1 35.7 78 79.7 78h40c-45.3-24.3-85.7-56.3-119.7-94.2z" fill="#0DCEA7" p-id="8292"></path><path d="M300.7 160.6h-56c-2.5 0-5 0.1-7.5 0.4-25.8 18.5-49.5 39.6-70.7 63.1-0.9 4.7-1.4 9.6-1.4 14.6V278c35-49.2 81.6-89.6 135.6-117.4zM861 765.4V275c-29.8-44.5-67.5-83.3-111-114.4h-76.8c-10.9 0-19.8-8.7-19.8-19.4v-5.5c0-11-3-21.4-8.1-30.3C598 88.1 547 78.7 493.8 78.7c-34.7 0-68.4 4-100.8 11.6-11.7 10.6-19.3 25.4-20.2 42.1 32.5-9 66.8-13.9 102.2-13.9 210.4 0 381 170.6 381 381s-170.6 381-381 381c-127.8 0-240.9-62.9-310-159.5v93.8c34 37.9 74.4 69.9 119.6 94.3H703c63.7-34.3 118-83.8 158-143.7z" fill="#1DD49C" p-id="8293"></path><path d="M475 880.5c210.4 0 381-170.6 381-381s-170.6-381-381-381c-35.4 0-69.7 4.8-102.2 13.9-0.1 1.1-0.1 2.2-0.1 3.3v5.5c0 10.7-8.9 19.4-19.8 19.4h-52.2c-54 27.8-100.6 68.2-135.7 117.3v66.8c50.7-110.1 162-186.5 291.2-186.5 177 0 320.5 143.5 320.5 320.5S633.2 799.2 456.2 799.2c-129.2 0-240.5-76.4-291.2-186.5V721c69.1 96.6 182.2 159.5 310 159.5z" fill="#2DDB92" p-id="8294"></path><path d="M456.2 799.2c177 0 320.5-143.5 320.5-320.5S633.2 158.2 456.2 158.2c-129.2 0-240.5 76.4-291.2 186.5v268.1c50.7 110 162 186.4 291.2 186.4zM437.4 198c143.6 0 260 116.4 260 260S581 718 437.4 718s-260-116.4-260-260 116.4-260 260-260z" fill="#3DE188" p-id="8295"></path><path d="M437.4 718c143.6 0 260-116.4 260-260S581 198 437.4 198s-260 116.4-260 260 116.4 260 260 260z m-18.8-480.3c110.2 0 199.5 89.3 199.5 199.5s-89.3 199.5-199.5 199.5-199.5-89.3-199.5-199.5 89.3-199.5 199.5-199.5z" fill="#4CE77D" p-id="8296"></path><path d="M418.6 636.7c110.2 0 199.5-89.3 199.5-199.5s-89.3-199.5-199.5-199.5S219.1 327 219.1 437.2s89.3 199.5 199.5 199.5z m-18.8-359.3c76.8 0 139 62.2 139 139s-62.2 139-139 139-139-62.2-139-139 62.2-139 139-139z" fill="#5CEE73" p-id="8297"></path><path d="M399.8 416.5m-139 0a139 139 0 1 0 278 0 139 139 0 1 0-278 0Z" fill="#6CF468" p-id="8298"></path><path d="M590.3 91.9c24.8 0 45 19.6 45 43.7v5.5c0 20.6 17 37.4 37.8 37.4h108.2c34 0 61.7 26.9 61.7 60V831c0 33.1-27.7 60-61.7 60H244.7c-34 0-61.7-26.9-61.7-60V238.6c0-33.1 27.7-60 61.7-60h108.2c20.9 0 37.8-16.8 37.8-37.4v-5.5c0-24.1 20.2-43.7 45-43.7l154.6-0.1m0-18H435.7c-34.8 0-63 27.6-63 61.7v5.5c0 10.7-8.9 19.4-19.8 19.4H244.7c-44 0-79.7 34.9-79.7 78V831c0 43.1 35.7 78 79.7 78h536.7c44 0 79.7-34.9 79.7-78V238.6c0-43.1-35.7-78-79.7-78H673.1c-10.9 0-19.8-8.7-19.8-19.4v-5.5c0-34.1-28.2-61.8-63-61.8z" fill="#0EC69A" p-id="8299"></path><path d="M687 343.3H339c-28.8 0-52.2 23.4-52.2 52.2v348c0 28.8 23.4 52.2 52.2 52.2h348c28.8 0 52.2-23.4 52.2-52.2v-348c0-28.8-23.4-52.2-52.2-52.2zM648.7 559L474.3 722.8c-9.2 8.6-24.3-0.6-19.8-12l38.2-96c2.9-7.4-2.9-15.3-11.3-15.3h-78.1c-10.6 0-16-11.9-8.7-19.1l166.1-163.8c9-8.9 24.5 0.1 20.1 11.6L544 524.5c-2.8 7.4 3 15.1 11.3 15.1h84.9c10.7 0 16.1 12.2 8.5 19.4z" fill="#9CFFBD" p-id="8300"></path><path d="M239.4 378.6c-9.9 0-18-8.1-18-18V236.5c0-9.9 8.1-18 18-18s18 8.1 18 18v124.1c0 9.9-8 18-18 18zM239.4 448.2c-9.9 0-18-8.1-18-18v-10.5c0-9.9 8.1-18 18-18s18 8.1 18 18v10.5c0 9.9-8 18-18 18z" fill="#FFFFFF" p-id="8301"></path></svg>
|
After Width: | Height: | Size: 4.0 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><link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/><script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script><script defer="defer" src="js/chunk-vendors.59893432.js"></script><script defer="defer" src="js/app.a10400b4.js"></script><link href="css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="css/app.5b1ae1f9.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><link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/><script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script><script defer="defer" src="js/chunk-vendors.59893432.js"></script><script defer="defer" src="js/app.87fff635.js"></script><link href="css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="css/app.5b1ae1f9.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
src/linker.app/public/web/js/161.d7f3f332.js
Normal file
1
src/linker.app/public/web/js/161.d7f3f332.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/596.048030d7.js
Normal file
1
src/linker.app/public/web/js/596.048030d7.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[596],{7332:function(e,n,a){a.r(n),a.d(n,{default:function(){return O}});var t=a(6768);const s={class:"net-wrap app-wrap"},l={class:"inner absolute flex flex-column flex-nowrap"},i={class:"head"},o={class:"body flex-1 relative"},c={class:"status"};function r(e,n,a,r,u,d){const g=(0,t.g2)("Head"),p=(0,t.g2)("List"),v=(0,t.g2)("Status");return(0,t.uX)(),(0,t.CE)("div",s,[(0,t.Lk)("div",l,[(0,t.Lk)("div",i,[(0,t.bF)(g)]),(0,t.Lk)("div",o,[(0,t.bF)(p)]),(0,t.Lk)("div",c,[(0,t.bF)(v,{config:!1})])])])}a(4114);var u=a(4232);const d=e=>((0,t.Qi)("data-v-6bfe19a3"),e=e(),(0,t.jt)(),e),g={class:"head-wrap"},p={class:"tools flex"},v={class:"label"},h=d((()=>(0,t.Lk)("span",{class:"flex-1"},null,-1))),f={style:{"margin-left":"1rem"}};function k(e,n,a,s,l,i){const o=(0,t.g2)("Refresh"),c=(0,t.g2)("el-icon"),r=(0,t.g2)("el-button"),d=(0,t.g2)("Background");return(0,t.uX)(),(0,t.CE)("div",g,[(0,t.Lk)("div",p,[(0,t.Lk)("span",v,"分组 : "+(0,u.v_)(s.state.group),1),h,(0,t.bF)(r,{size:"small",onClick:s.handleRefresh},{default:(0,t.k6)((()=>[(0,t.eW)(" 刷新(F5)"),(0,t.bF)(c,null,{default:(0,t.k6)((()=>[(0,t.bF)(o)])),_:1})])),_:1},8,["onClick"]),(0,t.Lk)("div",f,[(0,t.bF)(d,{name:"net"})])])])}var C=a(3830),m=a(144),b=a(7477),L=a(5096),_={components:{Edit:b.ffu,Refresh:b.C42,Background:L.A},setup(){const e=(0,C.B)(),n=(0,m.Kh)({server:(0,t.EW)((()=>e.value.config.Client.Server.Host)),group:(0,t.EW)((()=>e.value.config.Client.Group.Name))}),a=()=>{window.location.reload()};return{state:n,handleRefresh:a}}},w=a(1241);const S=(0,w.A)(_,[["render",k],["__scopeId","data-v-6bfe19a3"]]);var F=S;const x=e=>((0,t.Qi)("data-v-68d1c30a"),e=e(),(0,t.jt)(),e),T={class:"net-list-wrap flex flex-column absolute"},z={class:"flex-1 scrollbar"},E={class:"flex"},A=x((()=>(0,t.Lk)("div",{class:"flex-1"},null,-1))),I={class:"tuntap"},P={class:"page t-c"},B={class:"page-wrap t-c"};function R(e,n,a,s,l,i){const o=(0,t.g2)("DeviceName"),c=(0,t.g2)("UpdaterBtn"),r=(0,t.g2)("TuntapShow"),u=(0,t.g2)("el-pagination");return(0,t.uX)(),(0,t.CE)("div",T,[(0,t.Lk)("div",z,[(0,t.Lk)("ul",null,[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(s.devices.page.List,((e,n)=>((0,t.uX)(),(0,t.CE)("li",{key:n},[(0,t.Lk)("dl",null,[(0,t.Lk)("dt",E,[(0,t.Lk)("div",null,[(0,t.bF)(o,{item:e},null,8,["item"])]),A,(0,t.Lk)("div",null,[(0,t.bF)(c,{config:!1,item:e},null,8,["item"])])]),(0,t.Lk)("dd",I,[s.tuntap.list[e.MachineId]?((0,t.uX)(),(0,t.Wv)(r,{key:0,item:e},null,8,["item"])):(0,t.Q3)("",!0)])])])))),128))])]),(0,t.Lk)("div",P,[(0,t.Lk)("div",B,[(0,t.bF)(u,{size:"small",background:"",layout:"prev,pager, next","pager-count":5,total:s.devices.page.Count,"page-size":s.devices.page.Request.Size,"current-page":s.devices.page.Request.Page,onCurrentChange:s.handlePageChange,onSizeChange:s.handlePageSizeChange,"page-sizes":[10,20,50,100,255]},null,8,["total","page-size","current-page","onCurrentChange","onSizeChange"])])])])}var D=a(8104),X=a(7985),y=a(9383),N=a(7115),U=a(263),Q=a(4877),W=a(9983),H={components:{StarFilled:b.BQ2,UpdaterBtn:N.A,DeviceName:U.A,TuntapShow:Q.A},setup(e){(0,C.B)();const n=(0,m.Kh)({}),{devices:a,machineId:s,_getSignList:l,_getSignList1:i,handleDeviceEdit:o,handlePageChange:c,handlePageSizeChange:r,handleDel:u,clearDevicesTimeout:d}=(0,X.r)(),{tuntap:g,_getTuntapInfo:p,handleTuntapRefresh:v,clearTuntapTimeout:h,handleTuntapEdit:f,sortTuntapIP:k}=(0,D.O)(),{_getUpdater:b,_subscribeUpdater:L,clearUpdaterTimeout:_}=(0,y.d)(),{connections:w,forwardConnections:S,_getForwardConnections:F,tuntapConnections:x,_getTuntapConnections:T,socks5Connections:z,_getSocks5Connections:E,handleTunnelConnections:A,clearConnectionsTimeout:I}=(0,W.L2)();return(0,t.sV)((()=>{c(),v(),l(),i(),p(),b(),L()})),(0,t.hi)((()=>{d(),h(),_()})),{state:n,devices:a,machineId:s,handlePageChange:c,handlePageSizeChange:r,tuntap:g}}};const K=(0,w.A)(H,[["render",R],["__scopeId","data-v-68d1c30a"]]);var j=K,q=a(9808),M=a(1387),V={components:{Head:F,List:j,Status:q.A},setup(){document.addEventListener("contextmenu",(function(e){e.preventDefault()}));const e=(0,C.B)(),n=(0,M.rd)();return(0,t.sV)((()=>{0==e.value.hasAccess("NetManager")&&n.push({name:"NoPermission"})})),{}}};const G=(0,w.A)(V,[["render",r],["__scopeId","data-v-6a3f3b43"]]);var O=G}}]);
|
1
src/linker.app/public/web/js/722.a5b34492.js
Normal file
1
src/linker.app/public/web/js/722.a5b34492.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/803.866efd3e.js
Normal file
1
src/linker.app/public/web/js/803.866efd3e.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/844.7ccf729e.js
Normal file
1
src/linker.app/public/web/js/844.7ccf729e.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/app.87fff635.js
Normal file
1
src/linker.app/public/web/js/app.87fff635.js
Normal file
File diff suppressed because one or more lines are too long
@@ -4,13 +4,15 @@ sidebar_position: 14
|
||||
|
||||
# 14、为爱发电
|
||||
|
||||
若此项目对您有用,您可以考虑通过 **[🔋为爱发电](https://afdian.com/a/snltty)** 赞助一笔小钱支持作者。作者将能有更多的金钱来测试和维护linker,并在项目上投入更多的时间和精力。
|
||||
|
||||
**感谢名单**
|
||||
若此项目对您有用,可以考虑通过 **[🔋为爱发电](https://afdian.com/a/snltty)** 对作者稍加支持,让作者更有动力,在项目上投入更多时间和精力
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>感谢名单</strong></summary>
|
||||
<div>
|
||||
- 米多贝克&米多网络工程
|
||||
- 阳阳
|
||||
|
||||
- 谢幕____(海那边的白月光)
|
||||
- swayer.
|
||||
- 浅浅
|
||||
</div>
|
||||
</details>
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using linker.libs.timer;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -6,8 +7,10 @@ namespace linker.libs
|
||||
{
|
||||
public static class GCHelper
|
||||
{
|
||||
[DllImport("kernel32.dll")]
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern bool SetProcessWorkingSetSize(IntPtr proc, int min, int max);
|
||||
[DllImport("psapi.dll", SetLastError = true)]
|
||||
private static extern bool EmptyWorkingSet(IntPtr hProcess);
|
||||
public static void FlushMemory()
|
||||
{
|
||||
try
|
||||
@@ -26,12 +29,22 @@ namespace linker.libs
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
SetProcessWorkingSetSize(Process.GetCurrentProcess().Handle, -1, -1);
|
||||
EmptyWorkingSet(Process.GetCurrentProcess().Handle);
|
||||
}
|
||||
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
|
||||
LoggerHelper.Instance.Debug($"Flush Memory");
|
||||
}
|
||||
public static void Gc(object obj)
|
||||
public static void EmptyWorkingSet()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.SuppressFinalize(obj);
|
||||
TimerHelper.SetIntervalLong(() =>
|
||||
{
|
||||
Process process = Process.GetCurrentProcess();
|
||||
if (process.WorkingSet64 / 1024 / 1024 > 200)
|
||||
{
|
||||
FlushMemory();
|
||||
}
|
||||
|
||||
}, 30000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,6 +45,8 @@ namespace linker.messenger.channel
|
||||
}
|
||||
private void OnConnected(ITunnelConnection connection)
|
||||
{
|
||||
if (connection == null) return;
|
||||
|
||||
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
|
||||
LoggerHelper.Instance.Warning($"{TransactionId} add connection {connection.GetHashCode()} {connection.ToJson()}");
|
||||
|
||||
|
@@ -58,8 +58,8 @@ namespace linker.messenger.tuntap
|
||||
};
|
||||
tuntapTransfer.OnSetupSuccess += () =>
|
||||
{
|
||||
SetMaps();
|
||||
SetAppNat();
|
||||
SetMaps();
|
||||
AddForward();
|
||||
};
|
||||
tuntapTransfer.OnShutdownBefore += () =>
|
||||
@@ -79,8 +79,8 @@ namespace linker.messenger.tuntap
|
||||
tuntapConfigTransfer.OnUpdate += () =>
|
||||
{
|
||||
tuntapDecenter.Refresh();
|
||||
SetMaps();
|
||||
SetAppNat();
|
||||
SetMaps();
|
||||
AddForward();
|
||||
_ = CheckDevice();
|
||||
};
|
||||
|
@@ -87,6 +87,10 @@ namespace linker.messenger.tuntap
|
||||
{
|
||||
TuntapInfo info = serializer.Deserialize<TuntapInfo>(data.Span);
|
||||
info.Available = true;
|
||||
if (tuntapInfos.TryGetValue(info.MachineId, out var old))
|
||||
{
|
||||
info.Delay = old.Delay;
|
||||
}
|
||||
tuntapInfos.AddOrUpdate(info.MachineId, info, (a, b) => info);
|
||||
listVersion.Increment();
|
||||
}
|
||||
@@ -96,6 +100,10 @@ namespace linker.messenger.tuntap
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.Available = true;
|
||||
if (tuntapInfos.TryGetValue(item.MachineId, out var old))
|
||||
{
|
||||
item.Delay = old.Delay;
|
||||
}
|
||||
tuntapInfos.AddOrUpdate(item.MachineId, item, (a, b) => item);
|
||||
}
|
||||
DataVersion.Increment();
|
||||
@@ -128,7 +136,7 @@ namespace linker.messenger.tuntap
|
||||
{
|
||||
tuntapProxy.SetIP(item.MachineId, NetworkHelper.ToValue(item.IP));
|
||||
}
|
||||
foreach (var item in Infos.Values.Where(c => c.IP.Equals(IPAddress.Any)))
|
||||
foreach (var item in Infos.Values.Where(c => c.Available==false || c.Exists || c.IP.Equals(IPAddress.Any)))
|
||||
{
|
||||
tuntapProxy.RemoveIP(item.MachineId);
|
||||
}
|
||||
@@ -146,7 +154,7 @@ namespace linker.messenger.tuntap
|
||||
HashSet<uint> hashSet = new HashSet<uint>();
|
||||
IPAddress wan = signInClientState.WanAddress.Address;
|
||||
|
||||
foreach (var item in infos.OrderBy(c => c.IP, new IPAddressComparer()).OrderByDescending(c => c.Status))
|
||||
foreach (var item in infos.Where(c => c.Available == true).OrderBy(c => c.IP, new IPAddressComparer()).OrderByDescending(c => c.Status))
|
||||
{
|
||||
item.Exists = hashSet.Contains(NetworkHelper.ToValue(item.IP));
|
||||
hashSet.Add(NetworkHelper.ToValue(item.IP));
|
||||
|
@@ -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.275" ProductVersion="0.0.0.275" 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.276" ProductVersion="0.0.0.276" 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
src/linker.tray.win/dist/linker.tray.win.exe
vendored
BIN
src/linker.tray.win/dist/linker.tray.win.exe
vendored
Binary file not shown.
@@ -7,10 +7,13 @@ namespace linker.tun
|
||||
{
|
||||
public LinkerTunPacketHookLevel Level => LinkerTunPacketHookLevel.Lowest;
|
||||
|
||||
|
||||
private readonly LinkerDstMapping linkerDstMapping = new LinkerDstMapping();
|
||||
public void SetMap(DstMapInfo[] maps)
|
||||
private bool checksum = true;
|
||||
public void SetMap(DstMapInfo[] maps,bool checksum = true)
|
||||
{
|
||||
linkerDstMapping.SetDsts(maps);
|
||||
this.checksum = checksum;
|
||||
}
|
||||
|
||||
public bool ReadAfter(ReadOnlyMemory<byte> packet)
|
||||
@@ -21,7 +24,7 @@ namespace linker.tun
|
||||
|
||||
public bool WriteBefore(string srcId, ReadOnlyMemory<byte> packet)
|
||||
{
|
||||
linkerDstMapping.ToRealDst(packet);
|
||||
linkerDstMapping.ToRealDst(packet, checksum);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,6 @@
|
||||
using linker.libs;
|
||||
using linker.snat;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace linker.tun
|
||||
{
|
||||
|
@@ -352,7 +352,7 @@ namespace linker.tun
|
||||
/// <param name="maps"></param>
|
||||
public void SetMap(DstMapInfo[] maps)
|
||||
{
|
||||
lanMap.SetMap(maps);
|
||||
lanMap.SetMap(maps, AppNat == false);
|
||||
}
|
||||
|
||||
public async Task<bool> CheckAvailable(bool order = false)
|
||||
|
@@ -445,6 +445,7 @@ namespace linker.tunnel
|
||||
/// <param name="connection"></param>
|
||||
private void _OnConnected(ITunnelConnection connection)
|
||||
{
|
||||
if (connection == null) return;
|
||||
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
|
||||
LoggerHelper.Instance.Debug($"tunnel connect {connection.RemoteMachineId}->{connection.RemoteMachineName} success->{connection.IPEndPoint}");
|
||||
|
||||
|
@@ -269,7 +269,7 @@ namespace linker.tunnel.connection
|
||||
|
||||
public bool Equals(ITunnelConnection connection)
|
||||
{
|
||||
return connection != null && GetHashCode() == connection.GetHashCode() && IPEndPoint.Equals(connection.IPEndPoint);
|
||||
return connection != null && GetHashCode() == connection.GetHashCode() && TransactionId == connection.TransactionId && IPEndPoint.Equals(connection.IPEndPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -423,7 +423,7 @@ namespace linker.tunnel.connection
|
||||
}
|
||||
public bool Equals(ITunnelConnection connection)
|
||||
{
|
||||
return connection != null && GetHashCode() == connection.GetHashCode() && IPEndPoint.Equals(connection.IPEndPoint);
|
||||
return connection != null && GetHashCode() == connection.GetHashCode() && TransactionId == connection.TransactionId && IPEndPoint.Equals(connection.IPEndPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -232,7 +232,7 @@ namespace linker.tunnel.connection
|
||||
ArrayPool<byte>.Shared.Return(heartData);
|
||||
}
|
||||
|
||||
private byte[] encodeBuffer = new byte[8 * 1024];
|
||||
private byte[] encodeBuffer = new byte[65 * 1024];
|
||||
public async Task<bool> SendAsync(ReadOnlyMemory<byte> data)
|
||||
{
|
||||
try
|
||||
@@ -330,7 +330,7 @@ namespace linker.tunnel.connection
|
||||
}
|
||||
public bool Equals(ITunnelConnection connection)
|
||||
{
|
||||
return connection != null && GetHashCode() == connection.GetHashCode() && IPEndPoint.Equals(connection.IPEndPoint);
|
||||
return connection != null && GetHashCode() == connection.GetHashCode() && TransactionId == connection.TransactionId && IPEndPoint.Equals(connection.IPEndPoint);
|
||||
}
|
||||
}
|
||||
}
|
@@ -21,11 +21,13 @@ namespace linker
|
||||
{
|
||||
LoggerHelper.Instance.Error(b.ExceptionObject + "");
|
||||
};
|
||||
/*
|
||||
TaskScheduler.UnobservedTaskException += (a, b) =>
|
||||
{
|
||||
if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG)
|
||||
LoggerHelper.Instance.Error(b.Exception + "");
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
//线程数
|
||||
@@ -68,6 +70,7 @@ namespace linker
|
||||
LoggerHelper.Instance.Debug($"linker are running....");
|
||||
|
||||
GCHelper.FlushMemory();
|
||||
GCHelper.EmptyWorkingSet();
|
||||
}
|
||||
|
||||
private static JsonDocument ParseArgs(string[] args)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
v1.8.0
|
||||
2025-05-21 17:05:11
|
||||
2025-05-24 03:04:45
|
||||
1. 一些累计更新
|
||||
2. 增加NAT类型检测
|
||||
3. 优化内网穿透,SNAT转换,防火墙
|
Reference in New Issue
Block a user