xfuture 1.5.2 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
package/config.js CHANGED
@@ -207,7 +207,7 @@ function get_external_rules(){
207
207
  }
208
208
  else {
209
209
  if (element.method == "block") {
210
- ips_block.push(element.content + "");
210
+ ips_block.push(element.content);
211
211
  }
212
212
  else if (element.method == "direct") {
213
213
  ips_direct.push(element.content);
@@ -216,54 +216,54 @@ function get_external_rules(){
216
216
  ips_proxy.push(element.content);
217
217
  }
218
218
  }
219
+ }
219
220
 
220
- if (ips_block.length > 0) {
221
- var x = {};
222
- x.outbound = "block";
223
- x.ip_cidr = ips_block;
224
- rules.push(x);
225
- }
221
+ if (ips_block.length > 0) {
222
+ var x = {};
223
+ x.outbound = "block";
224
+ x.ip_cidr = ips_block;
225
+ rules.push(x);
226
+ }
226
227
 
227
- if (ips_direct.length > 0) {
228
- var x = {};
229
- x.outbound = "direct";
230
- x.ip_cidr = ips_direct;
231
- rules.push(x);
232
- }
228
+ if (ips_direct.length > 0) {
229
+ var x = {};
230
+ x.outbound = "direct";
231
+ x.ip_cidr = ips_direct;
232
+ rules.push(x);
233
+ }
233
234
 
234
- if (ips_proxy.length > 0) {
235
- var x = {};
236
- x.outbound = "proxy";
237
- x.ip_cidr = ips_proxy;
238
- rules.push(x);
239
- }
235
+ if (ips_proxy.length > 0) {
236
+ var x = {};
237
+ x.outbound = "proxy";
238
+ x.ip_cidr = ips_proxy;
239
+ rules.push(x);
240
+ }
240
241
 
241
- if (domains_block.length > 0) {
242
- var x = {};
243
- x.outbound = "block";
244
- x.domain = domains_block;
245
- rules.push(x);
246
- }
242
+ if (domains_block.length > 0) {
243
+ var x = {};
244
+ x.outbound = "block";
245
+ x.domain = domains_block;
246
+ rules.push(x);
247
+ }
247
248
 
248
- if (domains_direct.length > 0) {
249
- var x = {};
250
- x.outbound = "direct";
251
- x.domain = domains_direct;
252
- rules.push(x);
253
- }
249
+ if (domains_direct.length > 0) {
250
+ var x = {};
251
+ x.outbound = "direct";
252
+ x.domain = domains_direct;
253
+ rules.push(x);
254
+ }
254
255
 
255
- if (domains_proxy.length > 0) {
256
- var x = {};
257
- x.outbound = "proxy";
258
- x.domain = domains_proxy;
259
- rules.push(x);
260
- }
256
+ if (domains_proxy.length > 0) {
257
+ var x = {};
258
+ x.outbound = "proxy";
259
+ x.domain = domains_proxy;
260
+ rules.push(x);
261
261
  }
262
262
  return rules;
263
263
  }
264
264
 
265
265
  function get_global_rules(server){
266
- var route = xConfig.general
266
+ var route = JSON.parse(JSON.stringify(xConfig.general));
267
267
  var rules = route.rules;
268
268
 
269
269
  if (server != null && server != undefined) {
@@ -303,7 +303,7 @@ function get_global_rules(server){
303
303
 
304
304
  function get_ai_rules(server) {
305
305
 
306
- var route = xConfig.general;
306
+ var route = JSON.parse(JSON.stringify(xConfig.general));
307
307
  var rules = route.rules;
308
308
 
309
309
  if (server != null && server != undefined) {
package/index.js CHANGED
@@ -36,7 +36,7 @@ class xFuture {
36
36
  if(this.driver.length == 0) return false;
37
37
  var xray_json = JSON.stringify(parser.parse(url));
38
38
  var sing_json = JSON.stringify(parser.getSingBox(url));
39
- console.log("json:", xray_json, " sing_json:", sing_json);
39
+ console.log("json:", xray_json, "====================>sing_json:", sing_json);
40
40
  var ok = ff.StartTunnel(xray_json, url, sing_json);
41
41
  if (ok) {
42
42
  ok = this.StartProxy();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xfuture",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "electron vpn sdk",
5
5
  "main": "x.js",
6
6
  "scripts": {
package/parser.js CHANGED
@@ -53,9 +53,8 @@ class xParser {
53
53
  var port = ipPorts[1] * 1
54
54
 
55
55
  var routing = {};
56
- var rules = [];
56
+ var rules = this.getRules();
57
57
  if (!this.isGlobalMode) {
58
- rules = this.getRules();
59
58
  routing.domainStrategy = "IPIfNonMatch";
60
59
  }
61
60
  else{
@@ -99,9 +98,8 @@ class xParser {
99
98
 
100
99
  var remark = suffix[1];
101
100
  var routing = {};
102
- var rules = [];
101
+ var rules = this.getRules();
103
102
  if (!this.isGlobalMode) {
104
- rules = this.getRules();
105
103
  routing.domainStrategy = "IPIfNonMatch";
106
104
  }
107
105
  else{
@@ -142,9 +140,8 @@ class xParser {
142
140
 
143
141
  var remark = suffix[1];
144
142
  var routing = {};
145
- var rules = [];
143
+ var rules = this.getRules();
146
144
  if (!this.isGlobalMode) {
147
- rules = this.getRules();
148
145
  routing.domainStrategy = "IPIfNonMatch";
149
146
  }
150
147
  else{