xfuture 1.2.6 → 1.2.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 CHANGED
@@ -17,14 +17,28 @@ parser.isGlobalMode = false;
17
17
 
18
18
  class xFuture {
19
19
 
20
+ init(){
21
+ if (this.driver == null || this.driver == undefined) {
22
+ this.driver = "";
23
+ }
24
+ if (this.tunModeEnable == null || this.tunModeEnable == undefined) {
25
+ this.tunModeEnable = false;
26
+ }
27
+ }
28
+
20
29
  SetPassword(password) {
21
30
  ff.SetPassword(password);
22
31
  }
23
32
 
24
- StartTunnel(url){
25
- if (this.driver == null || this.driver == undefined) {
26
- this.driver = "";
33
+ SetTunModeEnable(enable, exe_file, config_file){
34
+ this.tunModeEnable = enable;
35
+ if (!isMac) {
36
+ ff.SetTunModeEnable(enable, exe_file, config_file);
27
37
  }
38
+ }
39
+
40
+ StartTunnel(url){
41
+ this.init();
28
42
  if(this.driver.length == 0) return false;
29
43
  var json = JSON.stringify(parser.parse(url));
30
44
  console.log("json:", json);
@@ -37,11 +51,11 @@ class xFuture {
37
51
 
38
52
  StopTunnel(){
39
53
  ff.StopTunnel();
40
- this.StopProxy();
54
+ // this.StopProxy();
41
55
  }
42
56
 
43
57
  StartProxy(){
44
- if (isMac) return true;
58
+ if (isMac || this.tunModeEnable) return true;
45
59
  var ret = true;
46
60
  try {
47
61
  let process = spawn(this.driver, ["global", "socks=127.0.0.1:1081"])
@@ -60,7 +74,7 @@ class xFuture {
60
74
 
61
75
  // App 进程退出时调用该接口,否则会导致电脑出现断网情况
62
76
  StopProxy(){
63
- if (!isMac) {
77
+ if (!isMac && !this.tunModeEnable) {
64
78
  try {
65
79
  let process = spawn(this.driver, ["off"])
66
80
  process.on('close', function (code) {
Binary file
Binary file
@@ -0,0 +1,70 @@
1
+ {
2
+ "remark": "HongKong",
3
+ "log": {
4
+ "loglevel": "info"
5
+ },
6
+ "tun": {
7
+ "inet4_address": "172.19.0.1/30",
8
+ "stack": "system",
9
+ "mtu": 9000,
10
+ "auto_route": true,
11
+ "auto_detect_interface": true,
12
+ "override_android_vpn": false
13
+ },
14
+ "routing":{
15
+ "rules":[
16
+ {
17
+ "type":"field",
18
+ "domain":["geosite:cn"],
19
+ "outboundTag":"direct"
20
+ },
21
+ {
22
+ "type":"field",
23
+ "ip":["geoip:private", "geoip:cn"],
24
+ "outboundTag":"direct"
25
+ },
26
+ {
27
+ "type":"field",
28
+ "domain":["geosite:geolocation-!cn"],
29
+ "outboundTag":"proxy"
30
+ }
31
+ ]
32
+ },
33
+ "outbounds":[
34
+ {
35
+ "protocol": "vmess",
36
+ "tag": "proxy",
37
+ "settings":{
38
+ "vnext":[
39
+ {
40
+ "address":"183.232.170.22",
41
+ "port":30061,
42
+ "users":[
43
+ {
44
+ "encryption":"",
45
+ "security":"auto",
46
+ "alterId":0,
47
+ "id":"54fc2504-f8d1-46f9-9ff5-f419953d02fb",
48
+ "flow":"",
49
+ "level":8
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "protocol": "freedom",
58
+ "tag": "direct"
59
+ },
60
+ {
61
+ "settings": {
62
+ "response": {
63
+ "type": "http"
64
+ }
65
+ },
66
+ "protocol": "blackhole",
67
+ "tag": "block"
68
+ }
69
+ ]
70
+ }
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xfuture",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "electron vpn sdk",
5
5
  "main": "x.js",
6
6
  "scripts": {
@@ -30,6 +30,8 @@
30
30
  "package/windows/sysproxy.exe",
31
31
  "package/windows/xFuture.node",
32
32
  "package/windows/xray.dll",
33
+ "package/windows/xray.exe",
34
+ "package/windows/config.json",
33
35
  "resources/geoip.dat",
34
36
  "resources/geosite.dat"
35
37
  ],