xtunnel 1.0.0 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -114,24 +114,8 @@
114
114
  ],
115
115
  "dns": {},
116
116
  "routing": {
117
- "domainStrategy": "IPOnDemand",
118
- "rules": [
119
- {
120
- "type": "field",
121
- "outboundTag": "direct",
122
- "domain": [
123
- "geosite:cn"
124
- ]
125
- },
126
- {
127
- "type": "field",
128
- "outboundTag": "direct",
129
- "ip": [
130
- "geoip:cn",
131
- "geoip:private"
132
- ]
133
- }
134
- ]
117
+ "domainStrategy": "AsIs",
118
+ "rules": []
135
119
  },
136
120
  "transport": {}
137
121
  }
package/core/config.json CHANGED
@@ -1 +1,90 @@
1
- {"log":{"error":"","loglevel":"warning","access":""},"inbounds":[{"listen":"127.0.0.1","protocol":"socks","settings":{"udp":false,"auth":"noauth"},"port":"1080"},{"listen":"127.0.0.1","protocol":"http","settings":{"timeout":360,"port":"1087"},"port":"1087"}],"outbounds":[{"mux":{"enabled":false,"concurrency":8},"protocol":"vmess","streamSettings":{"wsSettings":{"path":"/v2ray","headers":{"host":""}},"tlsSettings":{"allowInsecure":true},"security":"none","network":"ws"},"tag":"proxy","settings":{"vnext":[{"address":"u3.amazonfeed.net","users":[{"id":"d289df49-72eb-3b11-b83f-928b0a0f0dfc","alterId":2,"level":0,"security":"aes-128-gcm"}],"port":11101}]}},{"tag":"direct","protocol":"freedom","settings":{"domainStrategy":"UseIP","redirect":"","userLevel":0}},{"tag":"block","protocol":"blackhole","settings":{"response":{"type":"none"}}}],"dns":{},"routing":{"domainStrategy":"IPOnDemand","rules":[{"type":"field","outboundTag":"direct","domain":["geosite:cn"]},{"type":"field","outboundTag":"direct","ip":["geoip:cn","geoip:private"]}]},"transport":{}}
1
+ {
2
+ "log": {
3
+ "error": "",
4
+ "loglevel": "warning",
5
+ "access": ""
6
+ },
7
+ "inbounds": [
8
+ {
9
+ "listen": "127.0.0.1",
10
+ "protocol": "socks",
11
+ "settings": {
12
+ "udp": false,
13
+ "auth": "noauth"
14
+ },
15
+ "port": "1080"
16
+ },
17
+ {
18
+ "listen": "127.0.0.1",
19
+ "protocol": "http",
20
+ "settings": {
21
+ "timeout": 360,
22
+ "port": "1087"
23
+ },
24
+ "port": "1087"
25
+ }
26
+ ],
27
+ "outbounds": [
28
+ {
29
+ "mux": {
30
+ "enabled": false,
31
+ "concurrency": 8
32
+ },
33
+ "protocol": "vmess",
34
+ "streamSettings": {
35
+ "wsSettings": {
36
+ "path": "/v2ray",
37
+ "headers": {
38
+ "host": ""
39
+ }
40
+ },
41
+ "tlsSettings": {
42
+ "allowInsecure": true
43
+ },
44
+ "security": "none",
45
+ "network": "ws"
46
+ },
47
+ "tag": "proxy",
48
+ "settings": {
49
+ "vnext": [
50
+ {
51
+ "address": "u3.amazonfeed.net",
52
+ "users": [
53
+ {
54
+ "id": "d289df49-72eb-3b11-b83f-928b0a0f0dfc",
55
+ "alterId": 2,
56
+ "level": 0,
57
+ "security": "aes-128-gcm"
58
+ }
59
+ ],
60
+ "port": 11101
61
+ }
62
+ ]
63
+ }
64
+ },
65
+ {
66
+ "tag": "direct",
67
+ "protocol": "freedom",
68
+ "settings": {
69
+ "domainStrategy": "UseIP",
70
+ "redirect": "",
71
+ "userLevel": 0
72
+ }
73
+ },
74
+ {
75
+ "tag": "block",
76
+ "protocol": "blackhole",
77
+ "settings": {
78
+ "response": {
79
+ "type": "none"
80
+ }
81
+ }
82
+ }
83
+ ],
84
+ "dns": {},
85
+ "routing": {
86
+ "domainStrategy": "AsIs",
87
+ "rules": []
88
+ },
89
+ "transport": {}
90
+ }
package/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env node
2
+
1
3
  const program = require('commander')
2
4
  const axios = require('axios')
3
5
  const config = require('config')
@@ -9,15 +11,10 @@ let rayProcess = null
9
11
 
10
12
  process.on('SIGINT', () => stop())
11
13
 
12
- program
13
- .version('1.0.0')
14
- .description('Tunnel CLI')
15
- program
16
- .command('* <url>')
17
- .action(url => url && init(url))
14
+ program.version('1.0.0').description('Tunnel CLI')
15
+ program.command('* <url>').action(url => url && init(url))
18
16
  program.parse(process.argv)
19
17
 
20
-
21
18
  async function init(url) {
22
19
  try {
23
20
  let res = await axios.get(url)
@@ -39,7 +36,6 @@ async function init(url) {
39
36
  function switchServer(server) {
40
37
  // 切换服务器
41
38
  config.tpl.inbounds[1].settings.port = config.setting.localHttpPort
42
- config.tpl.routing = config.routingGlobal
43
39
  config.tpl.outbounds[0].settings.vnext[0].address = server.add
44
40
  config.tpl.outbounds[0].settings.vnext[0].port = server.port
45
41
  config.tpl.outbounds[0].settings.vnext[0].users[0].id = server.id
@@ -50,6 +46,7 @@ function start() {
50
46
  // 关闭上个进程
51
47
  rayProcess && rayProcess.kill('SIGINT')
52
48
  // 设置系统代理
49
+ console.log(config.setting.localHttpPort)
53
50
  setSystemProxy(config.setting.localHttpPort)
54
51
  // 根据操作系统平台-启动新进程
55
52
  rayProcess = child_process.exec(path.join(__dirname, './core/xray-linux-x64'), (error, stdout, stderr) => error && stop() && console.error('启动失败,请检查权限/端口占用'))
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "xtunnel",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "xtunnel",
5
5
  "main": "index.js",
6
6
  "scripts": {},
7
7
  "bin": {
8
- "tunnel": "./index.js"
8
+ "tunnel": "index.js"
9
9
  },
10
10
  "author": "cheney",
11
11
  "license": "ISC",
package/core/geoip.dat DELETED
Binary file