xtunnel 1.2.0 → 1.4.6

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,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]
@@ -66,4 +66,14 @@ function setSystemProxy(port) {
66
66
  let command1 = `git config --global --unset http.sslBackend && git config --global --unset http.proxy`
67
67
  child_process.exec(command1)
68
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
+ })
69
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xtunnel",
3
- "version": "1.2.0",
3
+ "version": "1.4.6",
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
  }