Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Readme #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,23 @@ 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/src/index.js <port number to forward to>`.
Once this is done compile the client with `npm run build` and then invoke the client with `node dist/srv/index.js <port number to forward to>`.

You'll see output like:
```
Expand All @@ -76,9 +79,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 <your 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 <your 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 <port number> 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 <port number> 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.

Expand All @@ -99,15 +102,15 @@ Once this is done, update `config-instance.ts` in `tunnelmole-client` to point t
```
const instanceConfig = {
hostip: {
endpoint: "wss://foo.com:81"
endpoint: "ws://foo.com:8080"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to not use the secure wss? it probably would not matter locally but if its exposed over the internet it should be encrypted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work locally.

},
runtime: {
debug: false,
debug: true,
enableLogging: true
}
}

export default instanceConfig;
export default instanceConfig
```

At that point, rebuild and run the client like below:
Expand Down Expand Up @@ -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!