xtunnel 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
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": "10800"
16
- },
17
- {
18
- "listen": "127.0.0.1",
19
- "protocol": "http",
20
- "settings": {
21
- "timeout": 360
22
- },
23
- "port": "10870"
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,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const program = require('commander')
4
- const axios = require('axios')
5
4
  const path = require('path')
6
5
  const fs = require('fs')
7
6
  const child_process = require('child_process')
@@ -21,7 +20,7 @@ program.parse(process.argv)
21
20
 
22
21
  async function run(url) {
23
22
  try {
24
- let res = await axios.get(url)
23
+ let res = await get(url)
25
24
  if (res.data) {
26
25
  subItems = Buffer.from(res.data, 'base64').toString().split("vmess://").map(o => Buffer.from(o, 'base64').toString()).filter(o => o)
27
26
  let server = subItems.map(o => JSON.parse(o)).filter(o => o.verify_cert)[0]
@@ -66,4 +65,14 @@ function setSystemProxy(port) {
66
65
  let command1 = `git config --global --unset http.sslBackend && git config --global --unset http.proxy`
67
66
  child_process.exec(command1)
68
67
  }
68
+ }
69
+
70
+ function get(url) {
71
+ return new Promise((resolve, reject) => {
72
+ https.get(url, res => {
73
+ let data = ''
74
+ res.on('data', chunk => data += chunk)
75
+ res.on('end', () => resolve({ data }))
76
+ }).on("error", error => reject(error))
77
+ })
69
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtunnel",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
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
  }