Difference between revisions of "Router Setup"
m (un-commented some stuff) |
m (Just added some example thing) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
==Quick Setup== | ==Quick Setup== | ||
You can download the router for all supported OS [https://demonsaw.com/download/demonsaw_router.zip 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.<br/> | You can download the router for all supported OS [https://demonsaw.com/download/demonsaw_router.zip 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.<br/> | ||
− | |||
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. | 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. | ||
Line 11: | Line 10: | ||
;Note: | ;Note: | ||
:You might need to [https://en.wikipedia.org/wiki/Port_forwarding port forward] your specified port in order get external connections through your home router, depending on your home router. | :You might need to [https://en.wikipedia.org/wiki/Port_forwarding 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 64<code>https://github.com/45khz/road_titan</code> | ||
+ | :Raspberry-pi <code>https://github.com/45khz/pi_titan</code> | ||
==Running the Router== | ==Running the Router== | ||
Line 27: | Line 30: | ||
<code>Load</code> 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.<br/> | <code>Load</code> 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.<br/> | ||
When this value reaches the maximum - as specified in the .toml - clients will get an error when connecting/initiating transfers. | 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 == | == demonsaw.toml == | ||
Line 41: | Line 53: | ||
:<code>port</code> defines the port your router will bind to. '''Default = 8000'''<br/> | :<code>port</code> defines the port your router will bind to. '''Default = 8000'''<br/> | ||
::'''Note:''' Some operating systems restrict some port ranges (usually all ports < 1024). Default ports for HTTP & HTTPS are 80 & 443. For alternative ports, [https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers click here]. | ::'''Note:''' Some operating systems restrict some port ranges (usually all ports < 1024). Default ports for HTTP & HTTPS are 80 & 443. For alternative ports, [https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers click here]. | ||
+ | :: If you would like to test that your port is correctly forwarded you can use [https://www.yougetsignal.com/tools/open-ports/ this tool] | ||
=== router.option === | === router.option === | ||
Line 64: | Line 77: | ||
:<code>address</code> defines the address of your transfer router. | :<code>address</code> defines the address of your transfer router. | ||
:<code>port</code> defines the port to use for this transfer router. '''Default = 80''' | :<code>port</code> 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.<br/> | ||
+ | It will look something like this: | ||
+ | |||
+ | <pre>[router.verified] | ||
+ | "client1" = "1576a92d6868ad3d567c33df3d38c004" | ||
+ | "some noob" = "651148715c016644d4e10a86ffb07587"</pre> | ||
+ | |||
+ | 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#client.verified|Client Setup]]. | ||
+ | |||
+ | == Example of demonsaw.toml == | ||
+ | This is a simple example of a .toml for a fully functional router. | ||
+ | |||
+ | <nowiki>[[router]]</nowiki> | ||
+ | enabled = true | ||
+ | threads = 128 | ||
+ | name = "Transfer Router" | ||
+ | address = "127.0.0.1" | ||
+ | port = 8080 | ||
+ | [router.option] | ||
+ | buffer_size = 32 | ||
+ | motd = "Welcome to Demonsaw 4" | ||
+ | redirect = <nowiki>"https://titan.wiki"</nowiki> | ||
+ | |||
+ | "127.0.0.1" is known as [https://en.wikipedia.org/wiki/Localhost localhost], and will only make you able to connect to yourself. Please replace it with your own, [https://www.whatismybrowser.com/detect/what-is-my-local-ip-address local IP]. | ||
+ | |||
+ | === A fully configured router... === | ||
+ | ... would look somnething like this: | ||
+ | |||
+ | <pre>[[router]] | ||
+ | enabled = true | ||
+ | threads = 128 | ||
+ | name = "Message Router #1" | ||
+ | address = "127.0.0.1" | ||
+ | password = "" | ||
+ | port = 8008 | ||
+ | [router.option] | ||
+ | buffer_size = 32 | ||
+ | motd = "Welcome to Demonsaw 4" | ||
+ | redirect = "https://titan.wiki/" | ||
+ | [[router.verified]] | ||
+ | "client1" = "1576a92d6868ad3d567c33df3d38c004" | ||
+ | [[router.room]] | ||
+ | enabled = true | ||
+ | name = "Room #1" | ||
+ | color = "ff52c175" | ||
+ | [[router.room]] | ||
+ | enabled = true | ||
+ | name = "Room #2" | ||
+ | color = "ff0c9bdc" | ||
+ | [[router.room]] | ||
+ | enabled = true | ||
+ | name = "Room #3" | ||
+ | color = "ffff029d" | ||
+ | [[router.router]] | ||
+ | enabled = true | ||
+ | name = "Transfer Router #1" | ||
+ | address = "127.0.0.1" | ||
+ | password = "" | ||
+ | port = 8080 | ||
+ | [[router.router]] | ||
+ | enabled = true | ||
+ | name = "Transfer Router #2" | ||
+ | address = "127.0.0.1" | ||
+ | password = "" | ||
+ | port = 8008</pre> |
Latest revision as of 00:59, 20 March 2018
This page will describe how to set up your own router, and how to configure it optimally.
Contents
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 64
https://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 = truethreads
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. Optionalport
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 = 32motd
defines the Message Of The Day, and is the message the router will send to a client that has successfully connected. Optionalredirect
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 = truename
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 = truename
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 = 128 name = "Transfer Router" address = "127.0.0.1" port = 8080 [router.option] buffer_size = 32 motd = "Welcome to Demonsaw 4" redirect = "https://titan.wiki"
"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.
A fully configured router...
... would look somnething like this:
[[router]] enabled = true threads = 128 name = "Message Router #1" address = "127.0.0.1" password = "" port = 8008 [router.option] buffer_size = 32 motd = "Welcome to Demonsaw 4" redirect = "https://titan.wiki/" [[router.verified]] "client1" = "1576a92d6868ad3d567c33df3d38c004" [[router.room]] enabled = true name = "Room #1" color = "ff52c175" [[router.room]] enabled = true name = "Room #2" color = "ff0c9bdc" [[router.room]] enabled = true name = "Room #3" color = "ffff029d" [[router.router]] enabled = true name = "Transfer Router #1" address = "127.0.0.1" password = "" port = 8080 [[router.router]] enabled = true name = "Transfer Router #2" address = "127.0.0.1" password = "" port = 8008