@rpcbase/cli 0.26.0 → 0.27.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/cli",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "license": "SSPL-1.0",
5
5
  "bin": {
6
6
  "rb": "./bin.js"
@@ -17,24 +17,28 @@ const get_port = (run_configs) => {
17
17
  const server_env_buf = fs.readFileSync(server_env_path)
18
18
  const parsed_env = dotenv.parse(server_env_buf)
19
19
 
20
- const port = parsed_env.SERVER_PORT
21
- return port
20
+ const server_port = parsed_env.SERVER_PORT
21
+ const wss_port = parsed_env.WSS_PORT
22
+
23
+ return {server_port, wss_port}
22
24
  }
23
25
 
24
26
 
25
27
  const start = (run_configs) => {
26
- const port = get_port(run_configs)
28
+ const {server_port, wss_port} = get_port(run_configs)
27
29
 
30
+ execSync(`${TAILSCALE_PATH} serve https:443 /wss http://127.0.0.1:${wss_port}`, {stdio: "inherit"})
31
+ execSync(`${TAILSCALE_PATH} serve https:443 / http://127.0.0.1:${server_port}`, {stdio: "inherit"})
28
32
  execSync(`${TAILSCALE_PATH} funnel 443 on`, {stdio: "inherit"})
29
- execSync(`${TAILSCALE_PATH} serve https / http://127.0.0.1:${port}`, {stdio: "inherit"})
30
33
  }
31
34
 
32
35
 
33
36
  const stop = (run_configs) => {
34
- const port = get_port(run_configs)
37
+ const {server_port, wss_port} = get_port(run_configs)
35
38
 
39
+ execSync(`${TAILSCALE_PATH} serve https:443 /socket http://127.0.0.1:${wss_port} off`, {stdio: "inherit"})
40
+ execSync(`${TAILSCALE_PATH} serve https:443 / http://127.0.0.1:${server_port} off`, {stdio: "inherit"})
36
41
  execSync(`${TAILSCALE_PATH} funnel 443 off`, {stdio: "inherit"})
37
- execSync(`${TAILSCALE_PATH} serve https / http://127.0.0.1:${port} off`, {stdio: "inherit"})
38
42
  }
39
43
 
40
44
  module.exports = {start, stop}