xtunnel 1.0.0 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/config/default.json +2 -18
- package/core/config.json +90 -1
- package/index.js +5 -8
- package/package.json +2 -2
- package/core/geoip.dat +0 -0
- package/core/geosite.dat +0 -11440
package/config/default.json
CHANGED
@@ -114,24 +114,8 @@
|
|
114
114
|
],
|
115
115
|
"dns": {},
|
116
116
|
"routing": {
|
117
|
-
"domainStrategy": "
|
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
|
-
{
|
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
|
-
|
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
package/core/geoip.dat
DELETED
Binary file
|