forked from KNEMC/KLALB
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8714a2ff9d
|
+1
-3
@@ -4,6 +4,7 @@
|
|||||||
<classpathentry kind="lib" path="lib/gson-2.1.jar"/>
|
<classpathentry kind="lib" path="lib/gson-2.1.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/javassist.jar" sourcepath="C:/Users/ADMINI~1/AppData/Local/Temp/1/.org.sf.feeling.decompiler1686963856070/source/javassist-3.29.2-GA-sources.jar"/>
|
<classpathentry kind="lib" path="lib/javassist.jar" sourcepath="C:/Users/ADMINI~1/AppData/Local/Temp/1/.org.sf.feeling.decompiler1686963856070/source/javassist-3.29.2-GA-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/ini4j.jar"/>
|
<classpathentry kind="lib" path="lib/ini4j.jar"/>
|
||||||
|
<classpathentry kind="lib" path="lib/JFreeChart1.5.2.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/toml4j-0.7.1.jar"/>
|
<classpathentry kind="lib" path="lib/toml4j-0.7.1.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/pcap4j-core-1.8.2.jar" sourcepath="C:/Users/ADMINI~1/AppData/Local/Temp/1/.org.sf.feeling.decompiler1725520274095/source/pcap4j-core-1.8.2-sources.jar"/>
|
<classpathentry kind="lib" path="lib/pcap4j-core-1.8.2.jar" sourcepath="C:/Users/ADMINI~1/AppData/Local/Temp/1/.org.sf.feeling.decompiler1725520274095/source/pcap4j-core-1.8.2-sources.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/pcap4j-packetfactory-propertiesbased-1.8.2.jar"/>
|
<classpathentry kind="lib" path="lib/pcap4j-packetfactory-propertiesbased-1.8.2.jar"/>
|
||||||
@@ -28,8 +29,5 @@
|
|||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="lib" path="lib/jfreechart-1.5.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="lib/jfreechart-1.5.3-javadoc.jar"/>
|
|
||||||
<classpathentry kind="lib" path="lib/jfreechart-1.5.3-sources.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -14,5 +14,3 @@ dashboard/.env.*.local
|
|||||||
|
|
||||||
/klalb-config.json
|
/klalb-config.json
|
||||||
/klalbconfig-old.json
|
/klalbconfig-old.json
|
||||||
|
|
||||||
/.slim/
|
|
||||||
Generated
-38
@@ -1,38 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="jfreechart-1.5.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jfreechart-1.5.3.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/disruptor-4.0.0.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/gson-2.1.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/ini4j.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/javassist.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/JavaTUN0.3.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jctools-core-4.0.6.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/KNElib1.0.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/KNEOptimize.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/pcap4j-core-1.8.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/pcap4j-packetfactory-propertiesbased-1.8.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/pcap4j-packetfactory-static-1.8.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/pcap4j-packettest-1.8.2-tests.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/pcap4j-sample-1.8.2.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/slf4j-api-2.0.9.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/slf4j-api-2.0.9-tests.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/toml4j-0.7.1.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/uuid-creator-6.1.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jctools-core-4.0.6-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jfreechart-1.5.3-sources.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/disruptor-4.0.0-sources.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/ini4j.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/JavaTUN0.3.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/jctools-core-4.0.6-sources.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/KNElib1.0.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/slf4j-api-2.0.9-sources.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/toml4j-0.7.1.jar!/" />
|
|
||||||
<root url="jar://$PROJECT_DIR$/lib/uuid-creator-6.1.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_26" project-jdk-name="jdk-26.0.1" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2">
|
||||||
<output url="file://$PROJECT_DIR$/classes" />
|
<output url="file://$PROJECT_DIR$/classes" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -39,7 +39,7 @@ No test suite, no CI. Classes named `*Test*` (`nathole/`, `ntp/`) are manual `ma
|
|||||||
|
|
||||||
- Entrypoint `org.kne.cloud.network.klalb.KLALBMain`: load config → build `KLALBProxySystem` → open Swing GUI (`KLALBStateGUI3`) unless `"nogui": true` → start `KLALBWebServer` (if `"webUI": true` or web server enabled, default port `4665`) → interactive console (`help`, `links-state`, `route`, `kperf`, ...).
|
- Entrypoint `org.kne.cloud.network.klalb.KLALBMain`: load config → build `KLALBProxySystem` → open Swing GUI (`KLALBStateGUI3`) unless `"nogui": true` → start `KLALBWebServer` (if `"webUI": true` or web server enabled, default port `4665`) → interactive console (`help`, `links-state`, `route`, `kperf`, ...).
|
||||||
- `org.kne.cloud.network.klalb.web.KLALBWebServer` — built-in HTTP/SSE server (JDK `HttpServer`):
|
- `org.kne.cloud.network.klalb.web.KLALBWebServer` — built-in HTTP/SSE server (JDK `HttpServer`):
|
||||||
- API endpoints: `/api/status`, `/api/events` (SSE stream, 200ms intervals), `/api/links`, `/api/links/action`, `/api/links/reconnect`, `/api/routing-table`, `/api/nodes` (topology graph), `/api/node-info?address=<ipv6>` (on-demand full node info), `/api/config`.
|
- API endpoints: `/api/status`, `/api/events` (SSE stream, 200ms intervals), `/api/links`, `/api/links/action`, `/api/links/reconnect`, `/api/routes`, `/api/nodes` (topology graph), `/api/interfaces`, `/api/config`.
|
||||||
- Static file hosting / SPA fallback: serves `dashboard/dist/` assets directly.
|
- Static file hosting / SPA fallback: serves `dashboard/dist/` assets directly.
|
||||||
- `org.kne.cloud.network` — generic socket framework: `VirtualSocket*` hierarchy, `SocketBridge` port-forwarding proxies, `ProtocolDetector` (multi-protocol mux on one port), `MultiProtocolSocketAddress` = URI-style addresses (`tcp://`, `udp://`, `kltp://`, `ntp://`) dispatched through the `SocketType` registry.
|
- `org.kne.cloud.network` — generic socket framework: `VirtualSocket*` hierarchy, `SocketBridge` port-forwarding proxies, `ProtocolDetector` (multi-protocol mux on one port), `MultiProtocolSocketAddress` = URI-style addresses (`tcp://`, `udp://`, `kltp://`, `ntp://`) dispatched through the `SocketType` registry.
|
||||||
- `...network.klalb` — app core: `KLALBController` (the virtual SRv6 network), `KLALBRemoteLink` (WAN lines), `*Packet` wire-format classes, virtual socket implementations.
|
- `...network.klalb` — app core: `KLALBController` (the virtual SRv6 network), `KLALBRemoteLink` (WAN lines), `*Packet` wire-format classes, virtual socket implementations.
|
||||||
@@ -59,7 +59,7 @@ No test suite, no CI. Classes named `*Test*` (`nathole/`, `ntp/`) are manual `ma
|
|||||||
Located in `dashboard/`:
|
Located in `dashboard/`:
|
||||||
- **Git layout**: `dashboard/` is a separate git repo wired in as a submodule (own origin on `git.code.cq.cn`). Commit frontend changes inside `dashboard/` first, then bump the submodule pointer in the parent repo — parent-repo commits alone do not capture them.
|
- **Git layout**: `dashboard/` is a separate git repo wired in as a submodule (own origin on `git.code.cq.cn`). Commit frontend changes inside `dashboard/` first, then bump the submodule pointer in the parent repo — parent-repo commits alone do not capture them.
|
||||||
- **Stack**: Vite + React 19 + TypeScript + Tailwind CSS v4 + `@base-ui/react` (style: `base-nova`, icons: `lucide-react`, toasts: `@base-ui/react/toast`).
|
- **Stack**: Vite + React 19 + TypeScript + Tailwind CSS v4 + `@base-ui/react` (style: `base-nova`, icons: `lucide-react`, toasts: `@base-ui/react/toast`).
|
||||||
- **Routing**: Hash-based routing (`#/overview`, `#/connections`, `#/routing-table`, `#/topology`, `#/settings`) for seamless SPA hosting under Java `KLALBWebServer`.
|
- **Routing**: Hash-based routing (`#/overview`, `#/connections`, `#/topology`, `#/settings`, etc.) for seamless SPA hosting under Java `KLALBWebServer`.
|
||||||
- **Package Manager**: `pnpm` (run all commands from `dashboard/` directory).
|
- **Package Manager**: `pnpm` (run all commands from `dashboard/` directory).
|
||||||
- **Component installation**: **Must** use CLI via `pnpm dlx shadcn@latest add <component>` (e.g. `pnpm dlx shadcn@latest add alert card badge toast`). Never create or fake shadcn components manually. Non-shadcn libs (`@xyflow/react`, `d3-force`) are installed via plain `pnpm add`.
|
- **Component installation**: **Must** use CLI via `pnpm dlx shadcn@latest add <component>` (e.g. `pnpm dlx shadcn@latest add alert card badge toast`). Never create or fake shadcn components manually. Non-shadcn libs (`@xyflow/react`, `d3-force`) are installed via plain `pnpm add`.
|
||||||
- **Commands**:
|
- **Commands**:
|
||||||
@@ -69,9 +69,7 @@ Located in `dashboard/`:
|
|||||||
- **Pages & data flow**:
|
- **Pages & data flow**:
|
||||||
- Overview / Connections read the SSE stream (`use-klalb-sse.ts`, 200ms pushes of status + links).
|
- Overview / Connections read the SSE stream (`use-klalb-sse.ts`, 200ms pushes of status + links).
|
||||||
- Settings loads/saves `/api/config` (`use-klalb-config.ts`); save payload must keep legacy field aliases alongside new names for compatibility.
|
- Settings loads/saves `/api/config` (`use-klalb-config.ts`); save payload must keep legacy field aliases alongside new names for compatibility.
|
||||||
- Routing table polls `/api/routing-table` every 1s (`use-routing-table.ts`); `cost` is delay-derived and displayed in milliseconds.
|
|
||||||
- Topology polls `/api/nodes` every 1s (`use-topology.ts`) — SSE does NOT carry topology.
|
- Topology polls `/api/nodes` every 1s (`use-topology.ts`) — SSE does NOT carry topology.
|
||||||
- Selecting a topology node queries `/api/node-info`; remote node descriptions require a full SRv6 node-info request and can time out after 3s.
|
|
||||||
- Topology layout: `d3-force` headless simulation (recomputed only when node/edge structure changes) rendered by `@xyflow/react` with custom `device-node` / `link-edge` components in `src/components/topology/`.
|
- Topology layout: `d3-force` headless simulation (recomputed only when node/edge structure changes) rendered by `@xyflow/react` with custom `device-node` / `link-edge` components in `src/components/topology/`.
|
||||||
- React hooks lint rule forbids `setState` synchronously inside effects — initialize form state via component `key` remount + lazy `useState(() => ...)` initializers (see `SettingsForm` pattern).
|
- React hooks lint rule forbids `setState` synchronously inside effects — initialize form state via component `key` remount + lazy `useState(() => ...)` initializers (see `SettingsForm` pattern).
|
||||||
|
|
||||||
|
|||||||
@@ -249,6 +249,5 @@
|
|||||||
</library>
|
</library>
|
||||||
</orderEntry>
|
</orderEntry>
|
||||||
<orderEntry type="jdk" jdkName="jdk-26.0.1" jdkType="JavaSDK" />
|
<orderEntry type="jdk" jdkName="jdk-26.0.1" jdkType="JavaSDK" />
|
||||||
<orderEntry type="library" name="jfreechart-1.5.3" level="project" />
|
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
//加速线路
|
||||||
|
{KLALBRemote}->43.248.189.107:35000
|
||||||
|
{KLALBRemote}->cn-bj-bgp-3.openfrp.top:65529
|
||||||
|
{KLALBRemote}->180.76.147.250:65529
|
||||||
|
{KLALBRemote}->cn-ah-dx-1.natfrp.cloud:65529
|
||||||
|
{KLALBRemote}->cn-nn-dx-1.natfrp.cloud:65529
|
||||||
|
{KLALBRemote}->cn-wh-dx-1.natfrp.cloud:65529
|
||||||
|
{KLALBRemote}->cn-zz-bgp-10.natfrp.cloud:23330
|
||||||
|
{KLALBRemote}->cn-zz-bgp-7.natfrp.cloud:33336
|
||||||
|
{KLALBRemote}->43.143.109.64:49965
|
||||||
|
{KLALBRemote}->frp.104300.xyz:49965
|
||||||
|
{KLALBRemote}->us.afrps.cn:49966
|
||||||
|
{KLALBRemote}->hk.afrps.cn:49966
|
||||||
|
{KLALBRemote}->la.afrps.cn:49966
|
||||||
|
{KLALBRemote}->frp.freefrp.net:49965
|
||||||
|
{KLALBRemote}->frp1.freefrp.net:49965
|
||||||
|
{KLALBRemote}->frp2.freefrp.net:49965
|
||||||
|
{KLALBRemote}->frp4.freefrp.net:49965
|
||||||
|
|
||||||
|
0.0.0.0:25565->{KLALBVirtual}[171d:a999:e697:4b23:ae52:9f29:4532:e1ee]:25565
|
||||||
+1
-1
Submodule dashboard updated: 89474b9e91...ad94d2c274
@@ -0,0 +1,79 @@
|
|||||||
|
[
|
||||||
|
{"Type":"KLALBController" ,
|
||||||
|
"TCPListen" : "0.0.0.0:4565",
|
||||||
|
"UDPListen" : "{UDP}0.0.0.0:4572",
|
||||||
|
"VirtualSocketName" : "KLALB_Stream",
|
||||||
|
"LineTable":["43.248.189.107:65529",
|
||||||
|
"cn-bj-bgp-3.openfrp.top:65529",
|
||||||
|
"180.76.147.250:65529",
|
||||||
|
"cn-ah-dx-1.natfrp.cloud:65529",
|
||||||
|
"cn-nn-dx-1.natfrp.cloud:65529",
|
||||||
|
"cn-wh-dx-1.natfrp.cloud:65529",
|
||||||
|
"cn-zz-bgp-10.natfrp.cloud:23330",
|
||||||
|
"cn-zz-bgp-7.natfrp.cloud:33336",
|
||||||
|
"43.143.109.64:49965",
|
||||||
|
"frp.104300.xyz:49965",
|
||||||
|
"us.afrps.cn:49966",
|
||||||
|
"hk.afrps.cn:49966",
|
||||||
|
"la.afrps.cn:49966",
|
||||||
|
"frp.freefrp.net:49965",
|
||||||
|
"frp1.freefrp.net:49965",
|
||||||
|
"frp2.freefrp.net:49965",
|
||||||
|
"frp4.freefrp.net:49965",
|
||||||
|
"cn-he-plc-2.openfrp.top:4572",
|
||||||
|
"{UDP}cn-he-plc-2.openfrp.top:4572",
|
||||||
|
"frp-mom.top:22226",
|
||||||
|
"frp-man.top:36555",
|
||||||
|
"us-sjc-bgp-2.openfrp.top:36555",
|
||||||
|
"us-sjc-bgp-1.openfrp.top:36555",
|
||||||
|
"[240e:340:d856:b700:6d02:6a6a:f9fc:865b]:4572"]
|
||||||
|
},
|
||||||
|
{"Type":"SocketBridge" ,
|
||||||
|
"Listen" : "0.0.0.0:4572",
|
||||||
|
"Bridge":{
|
||||||
|
"KLALB" : "SocketBridge",
|
||||||
|
"RDP":"SocketBridge",
|
||||||
|
"HTTP":"SocketBridge",
|
||||||
|
"HTTPS":"SocketBridge",
|
||||||
|
"DEFAULT":"MinecraftSocketBridge23332"
|
||||||
|
} ,
|
||||||
|
"Connect" : {
|
||||||
|
"KLALB" : "127.0.0.1:4565",
|
||||||
|
"RDP":"127.0.0.1:3389",
|
||||||
|
"HTTP":"127.0.0.1:5212",
|
||||||
|
"HTTPS":"192.168.1.235:443",
|
||||||
|
"DEFAULT":"127.0.0.1:36555"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{"Type":"SocketBridge" ,
|
||||||
|
"Listen" : "{KLALB_Stream}[::0]:23332",
|
||||||
|
"Bridge":"MinecraftSocketBridge23332",
|
||||||
|
"Connect" : "127.0.0.1:36555"
|
||||||
|
},
|
||||||
|
{ "Type":"SocketBridge" ,
|
||||||
|
"Listen" : "{KLALB_Stream}[::0]:23333",
|
||||||
|
"Bridge":"SocketBridge",
|
||||||
|
"Connect" : "127.0.0.1:5212"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{"Type":"SocketBridge" ,
|
||||||
|
"Listen" : "0.0.0.0:25561",
|
||||||
|
"Bridge":{
|
||||||
|
"KLALB" : "SocketBridge",
|
||||||
|
"DEFAULT":"MinecraftSocketBridge23330"
|
||||||
|
} ,
|
||||||
|
"Connect" : {
|
||||||
|
"KLALB" : "127.0.0.1:4565",
|
||||||
|
"DEFAULT":"127.0.0.1:25562"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{"Type":"SocketBridge" ,
|
||||||
|
"Listen" : "{KLALB_Stream}[::0]:23330",
|
||||||
|
"Bridge":"MinecraftSocketBridge23330",
|
||||||
|
"Connect" : "127.0.0.1:25562"
|
||||||
|
}
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,29 @@
|
|||||||
|
0.0.0.0:35000(RDP)->192.168.1.233:3389
|
||||||
|
0.0.0.0:35000(HTTPS)->192.168.1.233:8444
|
||||||
|
0.0.0.0:35000(HTTP)->192.168.1.233:5212
|
||||||
|
0.0.0.0:35000(SSH)->192.168.1.236:22
|
||||||
|
0.0.0.0:35000(KLALB)->{KLALBRemote}
|
||||||
|
0.0.0.0:35000->127.0.0.1:35001 //Winds服(普通线路)
|
||||||
|
|
||||||
|
{KLALBVirtual}[::0]:25565->127.0.0.1:35001 //Winds服(加速线路)
|
||||||
|
|
||||||
|
//加速线路
|
||||||
|
{KLALBRemote}->43.248.189.107:35000
|
||||||
|
{KLALBRemote}->cn-bj-bgp-3.openfrp.top:65529
|
||||||
|
{KLALBRemote}->180.76.147.250:65529
|
||||||
|
{KLALBRemote}->cn-ah-dx-1.natfrp.cloud:65529
|
||||||
|
{KLALBRemote}->cn-nn-dx-1.natfrp.cloud:65529
|
||||||
|
{KLALBRemote}->cn-wh-dx-1.natfrp.cloud:65529
|
||||||
|
{KLALBRemote}->cn-zz-bgp-10.natfrp.cloud:23330
|
||||||
|
{KLALBRemote}->cn-zz-bgp-7.natfrp.cloud:33336
|
||||||
|
{KLALBRemote}->43.143.109.64:49965
|
||||||
|
{KLALBRemote}->frp.104300.xyz:49965
|
||||||
|
{KLALBRemote}->us.afrps.cn:49966
|
||||||
|
{KLALBRemote}->hk.afrps.cn:49966
|
||||||
|
{KLALBRemote}->la.afrps.cn:49966
|
||||||
|
{KLALBRemote}->frp.freefrp.net:49965
|
||||||
|
{KLALBRemote}->frp1.freefrp.net:49965
|
||||||
|
{KLALBRemote}->frp2.freefrp.net:49965
|
||||||
|
{KLALBRemote}->frp4.freefrp.net:49965
|
||||||
|
|
||||||
|
0.0.0.0:25565->{KLALBVirtual}[171d:a999:e697:4b23:ae52:9f29:4532:e1ee]:25565
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
43.248.189.107:65529
|
||||||
|
cn-bj-bgp-3.openfrp.top:65529
|
||||||
|
180.76.147.250:65529
|
||||||
|
cn-ah-dx-1.natfrp.cloud:65529
|
||||||
|
cn-nn-dx-1.natfrp.cloud:65529
|
||||||
|
cn-wh-dx-1.natfrp.cloud:65529
|
||||||
|
cn-zz-bgp-10.natfrp.cloud:23330
|
||||||
|
cn-zz-bgp-7.natfrp.cloud:33336
|
||||||
|
43.143.109.64:49965
|
||||||
|
frp.104300.xyz:49965
|
||||||
|
us.afrps.cn:49966
|
||||||
|
hk.afrps.cn:49966
|
||||||
|
la.afrps.cn:49966
|
||||||
|
frp.freefrp.net:49965
|
||||||
|
frp1.freefrp.net:49965
|
||||||
|
frp2.freefrp.net:49965
|
||||||
|
frp4.freefrp.net:49965
|
||||||
|
cn-he-plc-2.openfrp.top:4569
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
0.0.0.0:35000(RDP)->192.168.1.233:3389
|
||||||
|
0.0.0.0:35000(HTTPS)->192.168.1.233:8444
|
||||||
|
0.0.0.0:35000(HTTP)->192.168.1.233:5212
|
||||||
|
0.0.0.0:35000(SSH)->192.168.1.236:22
|
||||||
|
0.0.0.0:35000(KLALB)->{KLALBRemote}
|
||||||
|
0.0.0.0:35000->127.0.0.1:35001 //Winds服(普通线路)
|
||||||
|
|
||||||
|
{KLALBVirtual}[::0]:25565->127.0.0.1:35001 //Winds服(加速线路)
|
||||||
@@ -115,5 +115,4 @@ multiscatter=Multi-Core - Spread Load Evenly (Optimized for multi-socket NUMA ar
|
|||||||
webapisettings=Web API settings
|
webapisettings=Web API settings
|
||||||
enablewebapi=Enable Web API
|
enablewebapi=Enable Web API
|
||||||
weblistenaddr=Web API listen address
|
weblistenaddr=Web API listen address
|
||||||
invaildweblistenaddr=Invalid Web API listen address
|
invaildweblistenaddr=Invalid Web API listen address
|
||||||
enabletun=Enable TUN adapter
|
|
||||||
|
|||||||
@@ -116,4 +116,3 @@ webapisettings=Web API 设置
|
|||||||
enablewebapi=启用 Web API
|
enablewebapi=启用 Web API
|
||||||
weblistenaddr=Web API 监听地址:端口
|
weblistenaddr=Web API 监听地址:端口
|
||||||
invaildweblistenaddr=无效的 Web API 监听地址:端口
|
invaildweblistenaddr=无效的 Web API 监听地址:端口
|
||||||
enabletun=启用TUN虚拟网卡
|
|
||||||
@@ -260,18 +260,18 @@ public class IPv6TUNLoopbackNetworkLink extends AbstractIPv6NetworkLink
|
|||||||
List<RouteItem> rlist = new ArrayList<>();
|
List<RouteItem> rlist = new ArrayList<>();
|
||||||
|
|
||||||
for (IPv6AddressGroup grp : getAddressGroups()) {
|
for (IPv6AddressGroup grp : getAddressGroups()) {
|
||||||
rlist.add(new RouteItem(new IPv6AddressGroup(grp.getAddress(), 128), grp.getAddress(), this, RouteItem.DIRECT, 0, 1,
|
rlist.add(new RouteItem(new IPv6AddressGroup(grp.getAddress(), 128), grp.getAddress(), this, "Direct", 0, 1,
|
||||||
null, "D"));
|
null, "D", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Iterator<Neighbor> iteratorx = getNeighborsInfo().iterator(); iteratorx.hasNext();) {
|
for (Iterator<Neighbor> iteratorx = getNeighborsInfo().iterator(); iteratorx.hasNext();) {
|
||||||
Neighbor addresses = (Neighbor) iteratorx.next();
|
Neighbor addresses = (Neighbor) iteratorx.next();
|
||||||
RouteItem ri = new RouteItem(new IPv6AddressGroup(addresses.getAddress().getAddress(), 128),
|
RouteItem ri = new RouteItem(new IPv6AddressGroup(addresses.getAddress().getAddress(), 128),
|
||||||
addresses.getAddress().getAddress(), this, RouteItem.SRv6_ENDXSID, 0, 128, null, "D");
|
addresses.getAddress().getAddress(), this, "Direct", 0, 128, null, "D", false);
|
||||||
rlist.add(ri);
|
rlist.add(ri);
|
||||||
|
|
||||||
RouteItem ris = new RouteItem(addresses.getLocator(), addresses.getLocator().getAddress(), this,
|
RouteItem ris = new RouteItem(addresses.getLocator(), addresses.getLocator().getAddress(), this,
|
||||||
RouteItem.SRv6_ENDSID, 13, 128, null, "D");
|
"KLALB SRv6", 13, 128, null, "D", false);
|
||||||
rlist.add(ris);
|
rlist.add(ris);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,18 +98,19 @@ public class LoopbackIPv6NetworkLink extends AbstractIPv6NetworkLink implements
|
|||||||
List<RouteItem> rlist = new ArrayList<>();
|
List<RouteItem> rlist = new ArrayList<>();
|
||||||
for(IPv6AddressGroup group:addressGroups) {
|
for(IPv6AddressGroup group:addressGroups) {
|
||||||
rlist.add(new RouteItem(new IPv6AddressGroup(group.getAddress(), 128),
|
rlist.add(new RouteItem(new IPv6AddressGroup(group.getAddress(), 128),
|
||||||
group.getAddress(), this, RouteItem.DIRECT, 0, 0, null, "D"));
|
group.getAddress(), this, "Direct", 0, 0, null, "D", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Iterator<Neighbor> iteratorx = getNeighborsInfo().iterator(); iteratorx.hasNext();) {
|
for (Iterator<Neighbor> iteratorx = getNeighborsInfo().iterator(); iteratorx.hasNext();) {
|
||||||
Neighbor addresses = (Neighbor) iteratorx.next();
|
Neighbor addresses = (Neighbor) iteratorx.next();
|
||||||
RouteItem ri = new RouteItem(new IPv6AddressGroup(addresses.getAddress().getAddress(), 128),
|
RouteItem ri = new RouteItem(new IPv6AddressGroup(addresses.getAddress().getAddress(), 128),
|
||||||
addresses.getAddress().getAddress(), this,RouteItem.SRv6_ENDXSID, 0, 128, null, "D");
|
addresses.getAddress().getAddress(), this, "Direct", 0, 128, null, "D",
|
||||||
|
false);
|
||||||
rlist.add(ri);
|
rlist.add(ri);
|
||||||
|
|
||||||
RouteItem ris = new RouteItem(addresses.getLocator(),
|
RouteItem ris = new RouteItem(addresses.getLocator(),
|
||||||
addresses.getLocator().getAddress(), this, RouteItem.SRv6_ENDSID, 13, 128,
|
addresses.getLocator().getAddress(), this, "KLALB SRv6", 13, 128,
|
||||||
null, "D");
|
null, "D", false);
|
||||||
rlist.add(ris);
|
rlist.add(ris);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ import java.util.Objects;
|
|||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
||||||
public static final String DIRECT="Direct";
|
|
||||||
public static final String SRv6_ENDSID="SRv6 ENDSID";
|
|
||||||
public static final String SRv6_ENDXSID="SRv6 ENDXSID";
|
|
||||||
|
|
||||||
private IPv6AddressGroup destination;
|
private IPv6AddressGroup destination;
|
||||||
private IPv6Address nexthop;
|
private IPv6Address nexthop;
|
||||||
private IPv6NetworkLink destlink;
|
private IPv6NetworkLink destlink;
|
||||||
@@ -16,6 +12,7 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
|||||||
private long cost;
|
private long cost;
|
||||||
private String flag;
|
private String flag;
|
||||||
private Supplier<Long> costSupplier;
|
private Supplier<Long> costSupplier;
|
||||||
|
private boolean isLoopback;
|
||||||
public String getFlag() {
|
public String getFlag() {
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
@@ -37,7 +34,7 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
|||||||
&& pre == other.pre && Objects.equals(proto, other.proto);
|
&& pre == other.pre && Objects.equals(proto, other.proto);
|
||||||
}
|
}
|
||||||
public RouteItem(IPv6AddressGroup destination, IPv6Address nexthop, IPv6NetworkLink destlink, String proto, int pre,
|
public RouteItem(IPv6AddressGroup destination, IPv6Address nexthop, IPv6NetworkLink destlink, String proto, int pre,
|
||||||
long cost,String flag) {
|
long cost,String flag,boolean isLoopback) {
|
||||||
super();
|
super();
|
||||||
this.destination = destination;
|
this.destination = destination;
|
||||||
this.nexthop = nexthop;
|
this.nexthop = nexthop;
|
||||||
@@ -46,9 +43,10 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
|||||||
this.pre = pre;
|
this.pre = pre;
|
||||||
this.cost = cost;
|
this.cost = cost;
|
||||||
this.flag=flag;
|
this.flag=flag;
|
||||||
|
this.isLoopback=isLoopback;
|
||||||
}
|
}
|
||||||
public RouteItem(IPv6AddressGroup destination, IPv6Address nexthop, IPv6NetworkLink destlink, String proto, int pre,
|
public RouteItem(IPv6AddressGroup destination, IPv6Address nexthop, IPv6NetworkLink destlink, String proto, int pre,
|
||||||
long cost,Supplier<Long> costSupplier,String flag) {
|
long cost,Supplier<Long> costSupplier,String flag,boolean isLoopback) {
|
||||||
super();
|
super();
|
||||||
this.destination = destination;
|
this.destination = destination;
|
||||||
this.nexthop = nexthop;
|
this.nexthop = nexthop;
|
||||||
@@ -58,6 +56,7 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
|||||||
this.cost = cost;
|
this.cost = cost;
|
||||||
this.costSupplier=costSupplier;
|
this.costSupplier=costSupplier;
|
||||||
this.flag=flag;
|
this.flag=flag;
|
||||||
|
this.isLoopback=isLoopback;
|
||||||
}
|
}
|
||||||
public IPv6AddressGroup getDestination() {
|
public IPv6AddressGroup getDestination() {
|
||||||
return destination;
|
return destination;
|
||||||
@@ -74,6 +73,9 @@ public class RouteItem implements Comparable<RouteItem>,Cloneable{
|
|||||||
public int getPre() {
|
public int getPre() {
|
||||||
return pre;
|
return pre;
|
||||||
}
|
}
|
||||||
|
public boolean isLoopback() {
|
||||||
|
return isLoopback;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getDestination()+"\t"+getProto()+"\t"+getPre()+"\t"+getCost()+"\t"+getFlag()+"\t"+getNexthop()+"\t"+getDestlink().getName();
|
return getDestination()+"\t"+getProto()+"\t"+getPre()+"\t"+getCost()+"\t"+getFlag()+"\t"+getNexthop()+"\t"+getDestlink().getName();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public class CONST {
|
|||||||
|
|
||||||
public static final String KLALB_S_RV6 = "KLALB_SRv6";
|
public static final String KLALB_S_RV6 = "KLALB_SRv6";
|
||||||
|
|
||||||
public static final String KLTP_VIRTUAL_SOCKET_NAME="kltp";
|
|
||||||
|
|
||||||
public static final int itemwidth = 1000;
|
public static final int itemwidth = 1000;
|
||||||
public static final int linepanelheight = 41;
|
public static final int linepanelheight = 41;
|
||||||
|
|||||||
@@ -687,7 +687,7 @@ public class KLALBController {
|
|||||||
// System.out.println(context);
|
// System.out.println(context);
|
||||||
try {
|
try {
|
||||||
NTPv4Protocol nvc = new NTPv4Protocol(context,
|
NTPv4Protocol nvc = new NTPv4Protocol(context,
|
||||||
new MultiProtocolSocketAddress(iproxyname + "datagram","0.0.0.0",123));
|
new MultiProtocolSocketAddress(iproxyname + "_Datagram","0.0.0.0",123));
|
||||||
srv6Router.addSRv6RouterListener(new SRv6RouterListener() {
|
srv6Router.addSRv6RouterListener(new SRv6RouterListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -698,7 +698,7 @@ public class KLALBController {
|
|||||||
for (Neighbor neighbor : nb) {
|
for (Neighbor neighbor : nb) {
|
||||||
if (neighbor.getLocator() != null)
|
if (neighbor.getLocator() != null)
|
||||||
sp.add(new NTPPeer(
|
sp.add(new NTPPeer(
|
||||||
new MultiProtocolSocketAddress(iproxyname + "datagram",
|
new MultiProtocolSocketAddress(iproxyname + "_Datagram",
|
||||||
neighbor.getLocator().getAddress().toString(), 123),
|
neighbor.getLocator().getAddress().toString(), 123),
|
||||||
NTPv4Packet.NTP_SYMMETRIC_ACTIVE));
|
NTPv4Packet.NTP_SYMMETRIC_ACTIVE));
|
||||||
|
|
||||||
@@ -978,8 +978,8 @@ public class KLALBController {
|
|||||||
|
|
||||||
|
|
||||||
public void registerToProxyTypeAs(String proxyname) {
|
public void registerToProxyTypeAs(String proxyname) {
|
||||||
MultiProtocolSocketAddress.getSocketTypeRegister().put(proxyname + "stream", streamSocketType);
|
MultiProtocolSocketAddress.getSocketTypeRegister().put(proxyname + "_Stream", streamSocketType);
|
||||||
MultiProtocolSocketAddress.getSocketTypeRegister().put(proxyname + "datagram", datagramSocketType);
|
MultiProtocolSocketAddress.getSocketTypeRegister().put(proxyname + "_Datagram", datagramSocketType);
|
||||||
// ProxyProfileEntry.getRegister().put(proxyname, this);
|
// ProxyProfileEntry.getRegister().put(proxyname, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ import org.kne.cloud.network.klalb.ui.UIEnv;
|
|||||||
import org.kne.cloud.network.perf.Kperf;
|
import org.kne.cloud.network.perf.Kperf;
|
||||||
import org.kne.cloud.network.perf.NodeBenchmark;
|
import org.kne.cloud.network.perf.NodeBenchmark;
|
||||||
import org.kne.debug.TimeDebugger;
|
import org.kne.debug.TimeDebugger;
|
||||||
import org.kne.membandboost.benchmark.*;;
|
import org.kne.membandboost.MembandBenchmark;
|
||||||
|
import org.kne.membandboost.ObjectPoolBandwidthTest;
|
||||||
|
|
||||||
public class KLALBMain {
|
public class KLALBMain {
|
||||||
public static KLALBStateGUI3 ksg;
|
public static KLALBStateGUI3 ksg;
|
||||||
@@ -238,6 +239,10 @@ public class KLALBMain {
|
|||||||
case "membandbenchmark":
|
case "membandbenchmark":
|
||||||
MembandBenchmark.main(args);
|
MembandBenchmark.main(args);
|
||||||
break;
|
break;
|
||||||
|
case "memqueuebenchmark":
|
||||||
|
|
||||||
|
ObjectPoolBandwidthTest.main(args);
|
||||||
|
break;
|
||||||
//case "$$SYSTEM:":
|
//case "$$SYSTEM:":
|
||||||
//System.out.println();
|
//System.out.println();
|
||||||
//break;
|
//break;
|
||||||
|
|||||||
@@ -168,11 +168,9 @@ public class KLALBProxySystem {
|
|||||||
|
|
||||||
|
|
||||||
String vsne=kcci.getVirtualSocketName();
|
String vsne=kcci.getVirtualSocketName();
|
||||||
if(vsne!=null) {
|
//if(vsne!=null) {
|
||||||
MultiProtocolSocketAddress.getSocketTypeRegister().put(vsne, klalbController.getStreamSocketType());
|
MultiProtocolSocketAddress.getSocketTypeRegister().put(vsne, klalbController.getStreamSocketType());
|
||||||
}else{
|
//}
|
||||||
MultiProtocolSocketAddress.getSocketTypeRegister().put(CONST.KLTP_VIRTUAL_SOCKET_NAME, klalbController.getStreamSocketType());
|
|
||||||
}
|
|
||||||
MultiProtocolSocketAddress tcple=kcci.getTCPListen();
|
MultiProtocolSocketAddress tcple=kcci.getTCPListen();
|
||||||
if(tcple!=null) {
|
if(tcple!=null) {
|
||||||
|
|
||||||
|
|||||||
@@ -959,12 +959,12 @@ public class KLALBRemoteLink extends AbstractControlledIPv6NetworkLink implement
|
|||||||
for (Iterator<Neighbor> iteratorx = getNeighborsInfo().iterator(); iteratorx.hasNext(); ) {
|
for (Iterator<Neighbor> iteratorx = getNeighborsInfo().iterator(); iteratorx.hasNext(); ) {
|
||||||
Neighbor addresses = (Neighbor) iteratorx.next();
|
Neighbor addresses = (Neighbor) iteratorx.next();
|
||||||
RouteItem ri = new RouteItem(new IPv6AddressGroup(addresses.getAddress().getAddress(), 128),
|
RouteItem ri = new RouteItem(new IPv6AddressGroup(addresses.getAddress().getAddress(), 128),
|
||||||
addresses.getAddress().getAddress(), this, RouteItem.SRv6_ENDXSID, 0, 128, CostSupplierFactory.expectedDelaySupplier((DelayMonitorData) addresses.getMonitor(), status, algorithm::getRTO), "D");
|
addresses.getAddress().getAddress(), this, "Direct", 0, 128, CostSupplierFactory.expectedDelaySupplier((DelayMonitorData) addresses.getMonitor(), status, algorithm::getRTO), "D", false);
|
||||||
rlist.add(ri);
|
rlist.add(ri);
|
||||||
|
|
||||||
if (addresses.getLocator() != null) {
|
if (addresses.getLocator() != null) {
|
||||||
RouteItem ris = new RouteItem(addresses.getLocator(), addresses.getLocator().getAddress(), this,
|
RouteItem ris = new RouteItem(addresses.getLocator(), addresses.getLocator().getAddress(), this,
|
||||||
RouteItem.SRv6_ENDSID, 13, 128, CostSupplierFactory.expectedDelaySupplier((DelayMonitorData) addresses.getMonitor(), status, algorithm::getRTO), "D");
|
"KLALB SRv6", 13, 128, CostSupplierFactory.expectedDelaySupplier((DelayMonitorData) addresses.getMonitor(), status, algorithm::getRTO), "D", false);
|
||||||
rlist.add(ris);
|
rlist.add(ris);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public class KLALBStateGUI3 extends XFrame {
|
|||||||
private JTextField addressField; // 地址显示框
|
private JTextField addressField; // 地址显示框
|
||||||
private JTextField addressFieldSet; // 地址设置框
|
private JTextField addressFieldSet; // 地址设置框
|
||||||
private JTextField asnFieldSet; // ASN设置框
|
private JTextField asnFieldSet; // ASN设置框
|
||||||
private JCheckBox enableTUN; // 虚拟网卡启用禁用
|
|
||||||
private JTextField tunDeviceName; // 虚拟网卡名称设置框
|
private JTextField tunDeviceName; // 虚拟网卡名称设置框
|
||||||
private JTextField webListenSet; // Web API 监听地址设置框
|
private JTextField webListenSet; // Web API 监听地址设置框
|
||||||
private NetworkGraphPanel graph; // 网络图面板
|
private NetworkGraphPanel graph; // 网络图面板
|
||||||
@@ -823,12 +822,6 @@ public class KLALBStateGUI3 extends XFrame {
|
|||||||
asnFieldSet = asn.getTextField();
|
asnFieldSet = asn.getTextField();
|
||||||
settings.getView().add(asn);
|
settings.getView().add(asn);
|
||||||
|
|
||||||
//虚拟网卡
|
|
||||||
CheckBoxSettingItem enableTUNs = new CheckBoxSettingItem(UIEnv.getRsb().getString("enabletun"),
|
|
||||||
CONST.itemwidth, CONST.settingheight);
|
|
||||||
enableTUN=enableTUNs.getCheckBox();
|
|
||||||
settings.getView().add(enableTUNs);
|
|
||||||
|
|
||||||
TextSettingItem tunName = new TextSettingItem(UIEnv.getRsb().getString("tunname"),
|
TextSettingItem tunName = new TextSettingItem(UIEnv.getRsb().getString("tunname"),
|
||||||
CONST.itemwidth, CONST.settingheight);
|
CONST.itemwidth, CONST.settingheight);
|
||||||
tunDeviceName = tunName.getTextField();
|
tunDeviceName = tunName.getTextField();
|
||||||
@@ -1158,8 +1151,6 @@ public class KLALBStateGUI3 extends XFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kck.setEnableTUN( enableTUN.isSelected());
|
|
||||||
|
|
||||||
String tunNameText=tunDeviceName.getText().trim();
|
String tunNameText=tunDeviceName.getText().trim();
|
||||||
if(tunNameText.equals("") || tunNameText.equalsIgnoreCase("null")) {
|
if(tunNameText.equals("") || tunNameText.equalsIgnoreCase("null")) {
|
||||||
kck.setTUNName(null);
|
kck.setTUNName(null);
|
||||||
@@ -1580,14 +1571,9 @@ public class KLALBStateGUI3 extends XFrame {
|
|||||||
Long vasn = kck.getVirtualASN();
|
Long vasn = kck.getVirtualASN();
|
||||||
asnFieldSet.setText(vasn != null ? vasn.toString() : "");
|
asnFieldSet.setText(vasn != null ? vasn.toString() : "");
|
||||||
|
|
||||||
enableTUN.setSelected(kck.isEnableTUN());
|
|
||||||
|
|
||||||
|
|
||||||
String tunname=kck.getTUNName();
|
String tunname=kck.getTUNName();
|
||||||
tunDeviceName.setText(tunname!=null?tunname:"");
|
tunDeviceName.setText(tunname!=null?tunname:"");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 加载Web API设置
|
// 加载Web API设置
|
||||||
webApiEnabled.setSelected(kck.isWebUI());
|
webApiEnabled.setSelected(kck.isWebUI());
|
||||||
webListenSet.setText(kck.getWebListen() != null ? kck.getWebListen().toString()
|
webListenSet.setText(kck.getWebListen() != null ? kck.getWebListen().toString()
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public class NetworkGraphPanel extends GraphPanel {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private double nsPerPixel=5000L;
|
private double nsPerPixel=1000L;
|
||||||
private class InetGraphEdgeGroup extends GraphEdgeGroup{
|
private class InetGraphEdgeGroup extends GraphEdgeGroup{
|
||||||
public InetGraphEdgeGroup(GraphNode nodeA, GraphNode nodeB) {
|
public InetGraphEdgeGroup(GraphNode nodeA, GraphNode nodeB) {
|
||||||
super(nodeA, nodeB);
|
super(nodeA, nodeB);
|
||||||
|
|||||||
@@ -68,9 +68,10 @@ public class KLALBWebServer {
|
|||||||
server.createContext("/api/links", this::handleLinks);
|
server.createContext("/api/links", this::handleLinks);
|
||||||
server.createContext("/api/links/action", this::handleLinkAction);
|
server.createContext("/api/links/action", this::handleLinkAction);
|
||||||
server.createContext("/api/links/reconnect", this::handleReconnectAll);
|
server.createContext("/api/links/reconnect", this::handleReconnectAll);
|
||||||
server.createContext("/api/routing-table", this::handleRoutingTable);
|
server.createContext("/api/routes", this::handleRoutes);
|
||||||
server.createContext("/api/nodes", this::handleNodes);
|
server.createContext("/api/nodes", this::handleNodes);
|
||||||
server.createContext("/api/node-info", this::handleNodeInfo);
|
server.createContext("/api/node-info", this::handleNodeInfo);
|
||||||
|
server.createContext("/api/interfaces", this::handleInterfaces);
|
||||||
server.createContext("/api/config", this::handleConfig);
|
server.createContext("/api/config", this::handleConfig);
|
||||||
|
|
||||||
// Static Files / SPA Fallback Handler
|
// Static Files / SPA Fallback Handler
|
||||||
@@ -428,7 +429,7 @@ public class KLALBWebServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleRoutingTable(HttpExchange exchange) throws IOException {
|
private void handleRoutes(HttpExchange exchange) throws IOException {
|
||||||
if (handleCorsPreflight(exchange)) return;
|
if (handleCorsPreflight(exchange)) return;
|
||||||
if (!"GET".equalsIgnoreCase(exchange.getRequestMethod())) {
|
if (!"GET".equalsIgnoreCase(exchange.getRequestMethod())) {
|
||||||
sendError(exchange, 405, "Method not allowed");
|
sendError(exchange, 405, "Method not allowed");
|
||||||
@@ -632,6 +633,33 @@ public class KLALBWebServer {
|
|||||||
sendJsonResponse(exchange, 200, result);
|
sendJsonResponse(exchange, 200, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleInterfaces(HttpExchange exchange) throws IOException {
|
||||||
|
if (handleCorsPreflight(exchange)) return;
|
||||||
|
if (!"GET".equalsIgnoreCase(exchange.getRequestMethod())) {
|
||||||
|
sendError(exchange, 405, "Method not allowed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
KLALBController kc = proxySystem.getKlalbController();
|
||||||
|
JsonArray ifacesArray = new JsonArray();
|
||||||
|
if (kc != null && kc.getNetworkInterfaceManager() != null) {
|
||||||
|
List<NetworkInterface> ifaces = kc.getNetworkInterfaceManager().getAllAvaliableNetworkInterface();
|
||||||
|
for (NetworkInterface nif : ifaces) {
|
||||||
|
JsonObject obj = new JsonObject();
|
||||||
|
obj.addProperty("name", nif.getName());
|
||||||
|
obj.addProperty("displayName", nif.getDisplayName());
|
||||||
|
JsonArray ips = new JsonArray();
|
||||||
|
List<InetAddress> addrs = kc.getNetworkInterfaceManager().getNetworkInterfaceAddress(nif);
|
||||||
|
for (InetAddress a : addrs) {
|
||||||
|
ips.add(new JsonPrimitive(a.getHostAddress()));
|
||||||
|
}
|
||||||
|
obj.add("addresses", ips);
|
||||||
|
ifacesArray.add(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sendJsonResponse(exchange, 200, ifacesArray);
|
||||||
|
}
|
||||||
|
|
||||||
private void handleConfig(HttpExchange exchange) throws IOException {
|
private void handleConfig(HttpExchange exchange) throws IOException {
|
||||||
if (handleCorsPreflight(exchange)) return;
|
if (handleCorsPreflight(exchange)) return;
|
||||||
String method = exchange.getRequestMethod();
|
String method = exchange.getRequestMethod();
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ public class KLALBRoutingProtocol extends Thread{
|
|||||||
while(true) {
|
while(true) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
byte[]ca=MembandBoost.allocateUninitializedByteArray(65535);
|
byte[]ca=MembandBoost.allocateUninitializedArray(65535);
|
||||||
DatagramPacket dgp=new DatagramPacket(ca, ca.length);
|
DatagramPacket dgp=new DatagramPacket(ca, ca.length);
|
||||||
ds.receive(dgp);
|
ds.receive(dgp);
|
||||||
//System.out.println(Arrays.toString( Arrays.copyOf( dgp.getData(),dgp.getLength())));
|
//System.out.println(Arrays.toString( Arrays.copyOf( dgp.getData(),dgp.getLength())));
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user