xfuture 2.8.3 → 2.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -1
 - package/package/darwin/xFuture.node +0 -0
 - package/package/win32-arm64/sysproxy.exe +0 -0
 - package/package/win32-arm64/xFuture.node +0 -0
 - package/package/win32-arm64/xray.dll +0 -0
 - package/package/win32-x64/sysproxy.exe +0 -0
 - package/package/win32-x64/xFuture.node +0 -0
 - package/package/win32-x64/xray.dll +0 -0
 - package/package.json +9 -1
 - package/parser.js +36 -0
 
    
        package/index.js
    CHANGED
    
    | 
         @@ -3,7 +3,12 @@ let os = require("os"); 
     | 
|
| 
       3 
3 
     | 
    
         
             
            const { spawn } = require('child_process')
         
     | 
| 
       4 
4 
     | 
    
         
             
            var isMac = false;
         
     | 
| 
       5 
5 
     | 
    
         
             
            if (os.platform() === "win32") {
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                if (os.arch() == "arm64") {
         
     | 
| 
      
 7 
     | 
    
         
            +
                  xFuturePath = "./package/win32-arm64/xFuture";
         
     | 
| 
      
 8 
     | 
    
         
            +
                }
         
     | 
| 
      
 9 
     | 
    
         
            +
                else {
         
     | 
| 
      
 10 
     | 
    
         
            +
                  xFuturePath = "./package/win32-x64/xFuture";
         
     | 
| 
      
 11 
     | 
    
         
            +
                }
         
     | 
| 
       7 
12 
     | 
    
         
             
            } else if (os.platform() === "darwin") {
         
     | 
| 
       8 
13 
     | 
    
         
             
                xFuturePath = "./package/darwin/xFuture"
         
     | 
| 
       9 
14 
     | 
    
         
             
                isMac = true;
         
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
    
        package/package.json
    CHANGED
    
    | 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            {
         
     | 
| 
       2 
2 
     | 
    
         
             
              "name": "xfuture",
         
     | 
| 
       3 
     | 
    
         
            -
              "version": "2.8. 
     | 
| 
      
 3 
     | 
    
         
            +
              "version": "2.8.8",
         
     | 
| 
       4 
4 
     | 
    
         
             
              "description": "electron vpn sdk",
         
     | 
| 
       5 
5 
     | 
    
         
             
              "main": "x.js",
         
     | 
| 
       6 
6 
     | 
    
         
             
              "scripts": {
         
     | 
| 
         @@ -30,6 +30,14 @@ 
     | 
|
| 
       30 
30 
     | 
    
         
             
                "package/win32/sysproxy.exe",
         
     | 
| 
       31 
31 
     | 
    
         
             
                "package/win32/xFuture.node",
         
     | 
| 
       32 
32 
     | 
    
         
             
                "package/win32/xray.dll",
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                "package/win32-arm64/sysproxy.exe",
         
     | 
| 
      
 35 
     | 
    
         
            +
                "package/win32-arm64/xFuture.node",
         
     | 
| 
      
 36 
     | 
    
         
            +
                "package/win32-arm64/xray.dll",
         
     | 
| 
      
 37 
     | 
    
         
            +
                "package/win32-x64/sysproxy.exe",
         
     | 
| 
      
 38 
     | 
    
         
            +
                "package/win32-x64/xFuture.node",
         
     | 
| 
      
 39 
     | 
    
         
            +
                "package/win32-x64/xray.dll",
         
     | 
| 
      
 40 
     | 
    
         
            +
                
         
     | 
| 
       33 
41 
     | 
    
         
             
                "resources/ai.json",
         
     | 
| 
       34 
42 
     | 
    
         
             
                "resources/global.json",
         
     | 
| 
       35 
43 
     | 
    
         
             
                "resources/geoip.dat",
         
     | 
    
        package/parser.js
    CHANGED
    
    | 
         @@ -16,9 +16,45 @@ class xParser { 
     | 
|
| 
       16 
16 
     | 
    
         
             
                    else if (uri.startsWith("trojan://")) {
         
     | 
| 
       17 
17 
     | 
    
         
             
                        return this.parseTrojan(uri);
         
     | 
| 
       18 
18 
     | 
    
         
             
                    }
         
     | 
| 
      
 19 
     | 
    
         
            +
                    else if (uri.startsWith("niuniu://")) {
         
     | 
| 
      
 20 
     | 
    
         
            +
                        return this.parseNiuniu(uri);
         
     | 
| 
      
 21 
     | 
    
         
            +
                    }
         
     | 
| 
       19 
22 
     | 
    
         
             
                    return {};
         
     | 
| 
       20 
23 
     | 
    
         
             
                }
         
     | 
| 
       21 
24 
     | 
    
         | 
| 
      
 25 
     | 
    
         
            +
                parseNiuniu(url){
         
     | 
| 
      
 26 
     | 
    
         
            +
                  url = url.substring(9);
         
     | 
| 
      
 27 
     | 
    
         
            +
                  var raw = url;
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
                  var info = raw.split("@");
         
     | 
| 
      
 30 
     | 
    
         
            +
                  if (info.length < 2) {
         
     | 
| 
      
 31 
     | 
    
         
            +
                      raw = this.decode(url);
         
     | 
| 
      
 32 
     | 
    
         
            +
                      info = raw.split("@");
         
     | 
| 
      
 33 
     | 
    
         
            +
                  }
         
     | 
| 
      
 34 
     | 
    
         
            +
                  if (info.length < 2) return {};
         
     | 
| 
      
 35 
     | 
    
         
            +
                  var config = info[1].split("?");
         
     | 
| 
      
 36 
     | 
    
         
            +
                  if (config.length < 2) return {};
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                  var ipAddress = config[0].split(":");
         
     | 
| 
      
 39 
     | 
    
         
            +
                  if (ipAddress.length < 2) return {};
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                  var address = ipAddress[0];
         
     | 
| 
      
 42 
     | 
    
         
            +
                  var port = ipAddress[1];
         
     | 
| 
      
 43 
     | 
    
         
            +
                  var suffix = config[1].split("#");
         
     | 
| 
      
 44 
     | 
    
         
            +
                  if (suffix.length < 2) return {};
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
                  var remark = suffix[1];
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                  var base = {};
         
     | 
| 
      
 49 
     | 
    
         
            +
                  
         
     | 
| 
      
 50 
     | 
    
         
            +
                  base.remark = remark;
         
     | 
| 
      
 51 
     | 
    
         
            +
                  base.address = address;
         
     | 
| 
      
 52 
     | 
    
         
            +
                  base.port = port * 1;
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
                  return base;
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                }
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
       22 
58 
     | 
    
         
             
                parseSS(url){
         
     | 
| 
       23 
59 
     | 
    
         
             
                    url = url.substring(5);
         
     | 
| 
       24 
60 
     | 
    
         
             
                    if (url.includes("@")) {
         
     |