From 35852dfa1ad6eaeb11e33dedd9c953275d14386b Mon Sep 17 00:00:00 2001 From: Reinhart Previano Koentjoro Date: Fri, 28 Apr 2023 10:29:11 +0700 Subject: [PATCH 1/3] fix: Readme 1. Replace instances of `dist/src/index.js` to `dist/srv/index.js` 2. Fix incorrect syntax for the configuration example (which was based on the TS-based tunnelmole-client project, not a valid TOML file) --- README.md | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 15bd808..c3e399a 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ const instanceConfig = { export default instanceConfig ``` -Once this is done compile the client with `npm run build` and then invoke the client with `node dist/src/index.js `. +Once this is done compile the client with `npm run build` and then invoke the client with `node dist/srv/index.js `. You'll see output like: ``` @@ -76,9 +76,9 @@ Replace the domain with the domain shown in your `tunnelmole-client` output. On Linux and Mac, your hosts file is located at `/etc/hosts`. On Windows, its located at `C:\Windows\System32\Drivers\etc\hosts`. -If you want custom domains or other "premium" features, add an API key to `src/authentication/apiKeys.json` in `tunnelmole-service`. You can then run `node dist/src/index.js --set-api-key `. All custom subdomains need to be added to your hosts file if you are running `tunnelmole-service` locally. +If you want custom domains or other "premium" features, add an API key to `src/authentication/apiKeys.json` in `tunnelmole-service`. You can then run `node dist/srv/index.js --set-api-key `. All custom subdomains need to be added to your hosts file if you are running `tunnelmole-service` locally. -Then run for example `node dist/src/index.js as mydomain.localhost` to get a custom subdomain. Add your chosen domain to your hosts file so your computer can resolve it. +Then run for example `node dist/srv/index.js as mydomain.localhost` to get a custom subdomain. Add your chosen domain to your hosts file so your computer can resolve it. Then start a web server listening on your chosen port and hit the `http` URL `tunnelmole-client` gave you you earlier in your browser or other HTTP client and it will work if you've set everything up correctly. @@ -97,22 +97,25 @@ Start the service with `node dist/srv/index.js`. If all went well, the service w Once this is done, update `config-instance.ts` in `tunnelmole-client` to point to your server. ``` -const instanceConfig = { - hostip: { - endpoint: "wss://foo.com:81" - }, - runtime: { - debug: false, - enableLogging: true - } -} +### +# Config for the web and websockets servers +# The password is for any routes you want to password protect +# By default this is only the endpoint that lists active connections for debugging purposes +### +[server] +httpPort = 80 +websocketPort = 81 +domain = 'foo.com' +password = 'changeme' -export default instanceConfig; +[runtime] +debug = true +enableLogging = false ``` At that point, rebuild and run the client like below: ``` -npm run build && node dist/src/index.js 3000 +npm run build && node dist/srv/index.js 3000 ``` Now you'll see output for your server's domain @@ -174,4 +177,3 @@ Thats the only difference between the code here and whats running on Tunnelmole. ### Official Website The official website for this project is at [https://tunnelmole.com](https://tunnelmole.com). Don't get Tunnelmole from anywhere else other than this website or the official GitHub repositories! - From 7b2de8891d08ae415036fd560911bf2eb6a97840 Mon Sep 17 00:00:00 2001 From: Reinhart Previano Koentjoro Date: Fri, 28 Apr 2023 11:18:01 +0700 Subject: [PATCH 2/3] fix: Revert client to dist/src/index.js --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3e399a..0b6556e 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ websocketPort = 81 domain = 'foo.com' password = '********' ``` -Start the service with `node dist/srv/index.js`. If all went well, the service will start with no errors. +Start the service with `node dist/src/index.js`. If all went well, the service will start with no errors. Once this is done, update `config-instance.ts` in `tunnelmole-client` to point to your server. ``` From 97758cf8904cbf210e69eacf3d36ca6388b8be9c Mon Sep 17 00:00:00 2001 From: Reinhart Previano Koentjoro Date: Fri, 28 Apr 2023 11:20:18 +0700 Subject: [PATCH 3/3] fix: Swapped example client and server config --- README.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 0b6556e..c34bf1b 100644 --- a/README.md +++ b/README.md @@ -45,17 +45,20 @@ When making any kind of changes to the code, always start off by running both th - Update `config-instance.toml` to match the following ``` -const instanceConfig = { - hostip: { - endpoint: "ws://localhost:8080" - }, - runtime: { - debug: true, - enableLogging: true - } -} +### +# Config for the web and websockets servers +# The password is for any routes you want to password protect +# By default this is only the endpoint that lists active connections for debugging purposes +### +[server] +httpPort = 80 +websocketPort = 81 +domain = 'foo.com' +password = 'changeme' -export default instanceConfig +[runtime] +debug = true +enableLogging = false ``` Once this is done compile the client with `npm run build` and then invoke the client with `node dist/srv/index.js `. @@ -93,29 +96,26 @@ websocketPort = 81 domain = 'foo.com' password = '********' ``` -Start the service with `node dist/src/index.js`. If all went well, the service will start with no errors. +Start the service with `node dist/srv/index.js`. If all went well, the service will start with no errors. Once this is done, update `config-instance.ts` in `tunnelmole-client` to point to your server. ``` -### -# Config for the web and websockets servers -# The password is for any routes you want to password protect -# By default this is only the endpoint that lists active connections for debugging purposes -### -[server] -httpPort = 80 -websocketPort = 81 -domain = 'foo.com' -password = 'changeme' +const instanceConfig = { + hostip: { + endpoint: "ws://foo.com:8080" + }, + runtime: { + debug: true, + enableLogging: true + } +} -[runtime] -debug = true -enableLogging = false +export default instanceConfig ``` At that point, rebuild and run the client like below: ``` -npm run build && node dist/srv/index.js 3000 +npm run build && node dist/src/index.js 3000 ``` Now you'll see output for your server's domain