xtunnel 1.1.5 → 1.4.5

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
@@ -1,89 +0,0 @@
1
- {
2
- "log": {
3
- "error": "",
4
- "loglevel": "error",
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
- },
23
- "port": "1087"
24
- }
25
- ],
26
- "outbounds": [
27
- {
28
- "mux": {
29
- "enabled": false,
30
- "concurrency": 8
31
- },
32
- "protocol": "vmess",
33
- "streamSettings": {
34
- "wsSettings": {
35
- "path": "/v2ray",
36
- "headers": {
37
- "host": ""
38
- }
39
- },
40
- "tlsSettings": {
41
- "allowInsecure": true
42
- },
43
- "security": "none",
44
- "network": "ws"
45
- },
46
- "tag": "proxy",
47
- "settings": {
48
- "vnext": [
49
- {
50
- "address": "u3.amazonfeed.net",
51
- "users": [
52
- {
53
- "id": "d289df49-72eb-3b11-b83f-928b0a0f0dfc",
54
- "alterId": 2,
55
- "level": 0,
56
- "security": "aes-128-gcm"
57
- }
58
- ],
59
- "port": 11101
60
- }
61
- ]
62
- }
63
- },
64
- {
65
- "tag": "direct",
66
- "protocol": "freedom",
67
- "settings": {
68
- "domainStrategy": "UseIP",
69
- "redirect": "",
70
- "userLevel": 0
71
- }
72
- },
73
- {
74
- "tag": "block",
75
- "protocol": "blackhole",
76
- "settings": {
77
- "response": {
78
- "type": "none"
79
- }
80
- }
81
- }
82
- ],
83
- "dns": {},
84
- "routing": {
85
- "domainStrategy": "AsIs",
86
- "rules": []
87
- },
88
- "transport": {}
89
- }
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const program = require('commander')
4
- const axios = require('axios')
4
+ const https = require('https')
5
5
  const path = require('path')
6
6
  const fs = require('fs')
7
7
  const child_process = require('child_process')
@@ -21,7 +21,7 @@ program.parse(process.argv)
21
21
 
22
22
  async function run(url) {
23
23
  try {
24
- let res = await axios.get(url)
24
+ let res = await get(url)
25
25
  if (res.data) {
26
26
  subItems = Buffer.from(res.data, 'base64').toString().split("vmess://").map(o => Buffer.from(o, 'base64').toString()).filter(o => o)
27
27
  let server = subItems.map(o => JSON.parse(o)).filter(o => o.verify_cert)[0]
@@ -56,7 +56,6 @@ function stop() {
56
56
  // 取消系统代理
57
57
  setSystemProxy()
58
58
  process.exit(1)
59
- return true
60
59
  }
61
60
 
62
61
  function setSystemProxy(port) {
@@ -67,4 +66,14 @@ function setSystemProxy(port) {
67
66
  let command1 = `git config --global --unset http.sslBackend && git config --global --unset http.proxy`
68
67
  child_process.exec(command1)
69
68
  }
69
+ }
70
+
71
+ function get(url) {
72
+ return new Promise((resolve, reject) => {
73
+ https.get(url, res => {
74
+ let data = ''
75
+ res.on('data', chunk => data += chunk)
76
+ res.on('end', () => resolve({ data }))
77
+ }).on("error", error => reject(error))
78
+ })
70
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtunnel",
3
- "version": "1.1.5",
3
+ "version": "1.4.5",
4
4
  "description": "xtunnel",
5
5
  "main": "index.js",
6
6
  "scripts": {},
@@ -10,7 +10,6 @@
10
10
  "author": "cheney",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "axios": "^0.24.0",
14
13
  "commander": "^8.3.0"
15
14
  }
16
15
  }