jointhis.proxy 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +31 -9
- package/dist/main.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -7,15 +7,35 @@ import UI from './ui.js';
|
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import { Spawn } from 'ink-spawn';
|
|
9
9
|
import { exec } from 'node:child_process';
|
|
10
|
-
export const version = `0.2.
|
|
10
|
+
export const version = `0.2.4`;
|
|
11
|
+
export var rtun;
|
|
11
12
|
// Get backend executable
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exec('
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
13
|
+
if (process.platform == 'linux') {
|
|
14
|
+
fs.open('./rtun-linux-amd64', 'r', (err, fd) => {
|
|
15
|
+
if (err) {
|
|
16
|
+
exec('wget https://github.com/snsinfu/reverse-tunnel/releases/download/v1.3.2/rtun-linux-amd64').on('exit', function () {
|
|
17
|
+
exec('chmod +x ./rtun-linux-amd64');
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
rtun = './rtun-linux-amd64';
|
|
22
|
+
}
|
|
23
|
+
else if (process.platform == 'win32') {
|
|
24
|
+
console.log('Windows support is experimental.');
|
|
25
|
+
fs.open('./rtun-windows-amd64.exe', 'r', (err, fd) => {
|
|
26
|
+
if (err) {
|
|
27
|
+
exec('curl -O https://github.com/snsinfu/reverse-tunnel/releases/download/v1.3.2/rtun-windows-amd64.exe');
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
rtun = './rtun-windows-amd64.exe';
|
|
31
|
+
}
|
|
32
|
+
else if (process.platform == 'darwin') {
|
|
33
|
+
console.log('Mac support is not yet implemented.');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.error('Unsupported Operating System.');
|
|
38
|
+
}
|
|
19
39
|
const cli = meow(`
|
|
20
40
|
Usage
|
|
21
41
|
$ jointhis.proxy
|
|
@@ -97,7 +117,9 @@ if (cli.flags.udp ||
|
|
|
97
117
|
console.log('Unable to write configuration file.');
|
|
98
118
|
process.exit(1);
|
|
99
119
|
}
|
|
100
|
-
|
|
120
|
+
else {
|
|
121
|
+
render(React.createElement(Spawn, { maxOutputLines: 4, runningText: "", command: rtun, args: ['-f ./rtun.yml'], shell: true }));
|
|
122
|
+
}
|
|
101
123
|
});
|
|
102
124
|
}
|
|
103
125
|
else {
|
package/dist/main.js
CHANGED
|
@@ -6,6 +6,7 @@ import SelectInput from 'ink-select-input';
|
|
|
6
6
|
import { Box } from 'ink';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import { Spawn } from 'ink-spawn';
|
|
9
|
+
import { rtun } from './cli.js';
|
|
9
10
|
export default function Main({ view }) {
|
|
10
11
|
const [key, Setkey] = useState('');
|
|
11
12
|
const [sub, Setsub] = useState('');
|
|
@@ -45,7 +46,7 @@ export default function Main({ view }) {
|
|
|
45
46
|
? 'Press enter to continue.'
|
|
46
47
|
: 'Please wait until everything is set up.')),
|
|
47
48
|
React.createElement(Step, { name: "last" },
|
|
48
|
-
React.createElement(Spawn, { maxOutputLines: 4, runningText: "", command:
|
|
49
|
+
React.createElement(Spawn, { maxOutputLines: 4, runningText: "", command: rtun, args: ['-f ./rtun.yml'], shell: true }),
|
|
49
50
|
React.createElement(Box, { marginTop: 1 },
|
|
50
51
|
React.createElement(Text, { dimColor: true }, "Press enter to quit")))));
|
|
51
52
|
}
|