Browse Source

Change CMake min version

xcbosa-itx 2 years ago
parent
commit
3b327ca527

+ 1 - 1
CMakeLists.txt

@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.24)
+cmake_minimum_required(VERSION 3.0)
 project(FRPCWebUI)
 
 set(CMAKE_CXX_STANDARD 17)

+ 1 - 1
controller/auto-generated/framework7-framework7-bundle.min.css.cpp

@@ -1,5 +1,5 @@
 //
-// Created by xcbosa on 2023-02-06
+// Created by xcbosa on 2023-02-07
 //
 
 #include "../../processor/processor.h"

+ 1 - 1
controller/auto-generated/framework7-framework7-bundle.min.js.cpp

@@ -1,5 +1,5 @@
 //
-// Created by xcbosa on 2023-02-06
+// Created by xcbosa on 2023-02-07
 //
 
 #include "../../processor/processor.h"

+ 1 - 1
controller/auto-generated/index.css.cpp

@@ -1,5 +1,5 @@
 //
-// Created by xcbosa on 2023-02-06
+// Created by xcbosa on 2023-02-07
 //
 
 #include "../../processor/processor.h"

+ 1 - 1
controller/auto-generated/index.js.cpp

@@ -1,5 +1,5 @@
 //
-// Created by xcbosa on 2023-02-06
+// Created by xcbosa on 2023-02-07
 //
 
 #include "../../processor/processor.h"

+ 1 - 1
controller/auto-generated/sha256.js.cpp

@@ -1,5 +1,5 @@
 //
-// Created by xcbosa on 2023-02-06
+// Created by xcbosa on 2023-02-07
 //
 
 #include "../../processor/processor.h"

+ 23 - 0
webuiconf.h

@@ -21,10 +21,33 @@ namespace xc::conf {
     const int mtu = 1536;
     const bool enableStaticAssetsController = false;
 
+    // 如果你的部分虚拟机是NAT网卡,装好brook,填写下面的字段
+    // 如果你想用iptables,请自行修改代码,很简单的,但我不会用所以我用brook
+    // 会自动的将用户的10.x.x.x:端口的IP地址先使用brook转发到本机::端口上,然后在frpc转发到本机
+    // 当然,并不影响独立IP虚拟机的端口转发,他们不满足10.x.x.x规则
+    // 如此优雅。
     const string natMachineIPPrefix = "10.";
     const int natMachineLocalhostPortBegin = 50000;
     const int natMachineLocalhostPortSize = 10000;
 
+    static queue<int> __natMachineLocalhostPortFreeList;
+    static int __natMachineLocalhostPortAllocator = natMachineLocalhostPortBegin;
+
+    /*分配NAT映射端口*/
+    static int natMachineLocalhostPortAllocate() {
+        if (__natMachineLocalhostPortFreeList.empty()) {
+            int allocated = __natMachineLocalhostPortAllocator++;
+            assert(allocated < natMachineLocalhostPortBegin + natMachineLocalhostPortSize);
+        }
+        int port = __natMachineLocalhostPortFreeList.front();
+        return port;
+    }
+
+    /*释放NAT映射端口*/
+    static int natMachineLocalhostPortFree(int port) {
+        __natMachineLocalhostPortFreeList.push(port);
+    }
+
     const string title("Frp-WebUI-XCBOSA");
     const int allowPortCountPerProfile(10);