Router Setup

From Titan wiki
Jump to: navigation, search

This page will describe how to set up your own router, and how to configure it optimally.

Quick Setup

You can download the router for all supported OS here. This is a .zip file, containing a folder for each OS. Within each of those folders, are the router binary, and a default .toml file.
What you need to change in order to just get it up and running, is simply the IP (to your own, local IP), and possibly the port.

For Linux users
Ports <1024 may be restricted to non-elevated users, so you might need to change the port in the .toml accordingly.
Note
You might need to port forward your specified port in order get external connections through your home router, depending on your home router.
There i very simple way to get starting as well one line bash script.
debian 64https://github.com/45khz/road_titan
Raspberry-pi https://github.com/45khz/pi_titan

Running the Router

When you execute the binary (preferably with a .500 Magnum), you'll be given a terminal window, prompting you to with version info, and <Press '?' for help>

You currently have 3 options in the terminal window
d - Show you the Dashboard, with some info about your router.
r - Restart the router (and maybe fix some issues?).
x - Exit and terminate the router.

When you show your dashboard, it'll show you the name of the router(s), the Address, Port, State, and Load. This is all the information you can get from the command line interface.

State will always be either OK or Error. If the latter is present, you'll have to review your .toml file, or your user permissions (running the binary as an elevated user might help).

Load indicates how many active threads you currently have. Each connected client will use 1 thread, and every transfer will use 1 additional thread (one for each upload and download). so 2 clients transferring a file between them will result in 4 active threads.
When this value reaches the maximum - as specified in the .toml - clients will get an error when connecting/initiating transfers.

Rules

These rules are built-in, and will apply:

  • If you have no transfer routers specified in your .toml, you are a message & transfer router (default). Meaning all traffic goes through this router.
  • If you have transfer routers specified, you are a message router only. Meaning all initiated transfers will be directed to the specified transfer routers.
    • Unless you are listed as a transfer router (either in your and others' .toml), then you are a message & transfer router.
  • Every transfer router is also a message router (by default), meaning you can connect to any router as a client.
  • If all transfer routers go offline the message router will become a transfer router.

demonsaw.toml

These are all the attributes possible to specify in the demonsaw-toml for the router.

enabled defines whether the router is enabled or not. Default = true
threads defines max threads that should be allocated to the router. Default = 128
Note: The more threads the more people can join the router (1 user will use around 2 threads or so).
name defines the (local) name of your router.
address defines the IP address your router should bind to. This should be "127.0.0.1", but can also be your internal IP.
Note: This is NOT the IP that others will use to connect to you with (unless they are on your local network). The IP others will have to use is you external IP, and can be found by simply searching for "What is my IP" on a search engine.
password defines the password required for client to connect to your router. Optional
port defines the port your router will bind to. Default = 8000
Note: Some operating systems restrict some port ranges (usually all ports < 1024). Default ports for HTTP & HTTPS are 80 & 443. For alternative ports, click here.
If you would like to test that your port is correctly forwarded you can use this tool

router.option

buffer_size defines the size of your buffer. Default = 32
motd defines the Message Of The Day, and is the message the router will send to a client that has successfully connected. Optional
redirect defines an URL that a user will be redirected to if connecting through a browser. Optional

router.room

This section creates a chat room available for anyone to join in the public group on your router. This room will not be available for anyone in a private group. One room is made for each copy of this section.

enabled defines whether the room is enabled or not. Default = true
name defines the name of the room as it is shown to connected clients.
color defines the color of the room. Because colors. Example: "#ffe56ffe"

router.router

This section defines your transfer router(s). Copy this section for however many transfer routers you want to use.

enabled defines whether this transfer router should be enabled or not. Default = true
name defines the (local) name of this transfer router.
address defines the address of your transfer router.
port defines the port to use for this transfer router. Default = 80

router.verified

If you want to verify clients on your router, you'll need to add the client names and a hash they've given you.
It will look something like this:

[router.verified]
  "client1" = "1576a92d6868ad3d567c33df3d38c004"
  "some noob" = "651148715c016644d4e10a86ffb07587"

This is all that is needed to be done router-side. To see what needs to be done by the client, go over to Client Setup.

Example of demonsaw.toml

This is a simple example of a .toml for a fully functional router.

[[router]]
  enabled = true
  threads = 1024
  name = "Transfer Router"
  address = "127.0.0.1"
  port = 80
  [router.option]
    buffer_size = 32
    motd = "Welcome to Demonsaw 4"
    redirect = https://www.demonsaw.com

"127.0.0.1" is known as localhost, and will only make you able to connect to yourself. Please replace it with your own, local IP.