xtunnel 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "setting": {
3
3
  "localHttpPort": "10870",
4
- "localSockPort": "1080",
4
+ "localSockPort": "10800",
5
5
  "subscribeLink": "",
6
6
  "selectedServer": "",
7
- "selectedMode": "PAC"
7
+ "selectedMode": "GLOBAL"
8
8
  },
9
9
  "routingPac": {
10
10
  "domainStrategy": "IPOnDemand",
@@ -44,7 +44,7 @@
44
44
  "udp": false,
45
45
  "auth": "noauth"
46
46
  },
47
- "port": "1080"
47
+ "port": "10800"
48
48
  },
49
49
  {
50
50
  "listen": "127.0.0.1",
@@ -52,7 +52,7 @@
52
52
  "settings": {
53
53
  "timeout": 360
54
54
  },
55
- "port": "1087"
55
+ "port": "10870"
56
56
  }
57
57
  ],
58
58
  "outbounds": [
package/core/config.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "udp": false,
13
13
  "auth": "noauth"
14
14
  },
15
- "port": "1080"
15
+ "port": "10800"
16
16
  },
17
17
  {
18
18
  "listen": "127.0.0.1",
@@ -20,7 +20,7 @@
20
20
  "settings": {
21
21
  "timeout": 360
22
22
  },
23
- "port": "1087"
23
+ "port": "10870"
24
24
  }
25
25
  ],
26
26
  "outbounds": [
package/index.js CHANGED
@@ -9,11 +9,11 @@ const config = JSON.parse(fs.readFileSync(path.join(__dirname, './config/default
9
9
 
10
10
  let rayProcess = null
11
11
 
12
- process.on('exit', stop())
13
- process.on('SIGINT', stop())
14
- process.on('SIGUSR1', stop())
15
- process.on('SIGUSR2', stop())
16
- process.on('uncaughtException', err => stop() && process.exit(1))
12
+ process.on('exit', stop)
13
+ process.on('SIGINT', stop)
14
+ process.on('SIGUSR1', stop)
15
+ process.on('SIGUSR2', stop)
16
+ process.on('uncaughtException', err => { stop(); process.exit(1) })
17
17
 
18
18
  program.version('1.0.0').description('Tunnel CLI')
19
19
  program.command('* <url>').action(url => url && run(url))
@@ -44,22 +44,18 @@ function start() {
44
44
  // 设置系统代理
45
45
  setSystemProxy(config.setting.localHttpPort)
46
46
  // 根据操作系统平台-启动新进程
47
- rayProcess = child_process.exec(path.join(__dirname, './core/xray-linux-x64'), (error, stdout, stderr) => error && stop(true))
47
+ rayProcess = child_process.exec(path.join(__dirname, './core/xray-linux-x64'), (error, stdout, stderr) => error && stop())
48
48
  rayProcess.stdout.on('data', console.log)
49
49
  rayProcess.stderr.on('data', console.error)
50
50
  }
51
51
 
52
- function stop(isRestart) {
52
+ function stop() {
53
53
  console.log('TUNNEL STOP')
54
54
  // 关闭上个进程
55
55
  rayProcess && rayProcess.kill('SIGINT')
56
56
  // 取消系统代理
57
57
  setSystemProxy()
58
- if (isRestart) {
59
- console.error('启动失败(请检查权限/端口占用),重新启动中...')
60
- start()
61
- }
62
- return true
58
+ process.exit(1)
63
59
  }
64
60
 
65
61
  function setSystemProxy(port) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtunnel",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "xtunnel",
5
5
  "main": "index.js",
6
6
  "scripts": {},