2020-06-18 21:54:48 +08:00
.. _internet-guide:
2020-06-18 18:26:18 +08:00
===================
Hosting on internet
===================
2020-02-20 21:38:15 +08:00
2020-06-22 20:54:18 +08:00
.. warning ::
Until now, those communications are not encrypted but are planned to be in a mid-term future (`Status <https://gitlab.com/slumber/multi-user/issues/62> `_ ).
2020-02-20 23:04:03 +08:00
This tutorial aims to guide you to host a collaborative Session on internet.
2020-06-22 20:54:18 +08:00
Hosting a session can be done is several ways:
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
- :ref: `host-blender` : hosting a session directly from the blender addon pannel
- :ref: `host-dedicated` : using a the dedicated server from a command line interface
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
.. _host-blender:
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
-------------
From blender
-------------
By default your router doesn't allow anyone to share you connection.
In order grant server access to people from internet you have tow main option:
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
* The :ref: `connection-sharing` : the easiest way.
* The :ref: `port-forwarding` : this one is the most unsecure, if you have no networking knowledge, you should definitively go to :ref: `connection-sharing` .
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
.. _connection-sharing:
2020-02-20 23:09:14 +08:00
2020-06-22 20:54:18 +08:00
Using a connection sharing solution
-----------------------------------
2020-02-20 23:04:03 +08:00
2020-06-22 23:25:44 +08:00
Many different third party software like `ZEROTIER <https://www.zerotier.com/download/> `_ (Free) or `HAMACHI <https://vpn.net/> `_ (Free until 5 users) allow you to share your private network with other peole.
For the example I'm gonna use ZeroTier because it (free and open soure).
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
.. _port-forwarding:
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
Using port-forwarding
---------------------
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
2. **Not secure** but simple: Setup port forwarding for each ports (for example 5555,5556,5557 and 5558 in our case). You can follow this `guide <https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router> `_ for example.
To know which port are used by the
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
Once you have setup the network, you can run **HOST** in order to start the server. Then other users could join your session in the regular way.
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
.. _host-dedicated:
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
--------------------------
From the dedicated server
--------------------------
2020-02-20 23:04:03 +08:00
2020-06-22 20:54:18 +08:00
.. code-block :: bash
docker run -it --rm \
-p 5555-5560:5555-5560 \
-e port=5555 \
-e password=admin \
-e timeout=1000 \
registry.gitlab.com/slumber/multi-user/multi-user-server:0.0.3
.. _port-setup:
-----------------------
Port setup (optionnal)
-----------------------
2020-02-20 21:38:15 +08:00
2020-06-22 20:54:18 +08:00
The multi-user network architecture is based on a clients-server model. The communication protocol use four ports to communicate with client:
* Commands: command transmission (such as **snapshots** , **change_rights** , etc.) [given port]
* Subscriber : pull data [Commands port + 1]
* Publisher : push data [Commands port + 2]
* TTL (time to leave) : used to ping each clients [Commands port + 3]
2020-02-20 21:38:15 +08:00
2020-06-22 20:54:18 +08:00
To know which ports will be used, you just have to read the port in your preference.
2020-02-20 21:38:15 +08:00
2020-06-22 20:54:18 +08:00
.. figure :: img/hosting_guide_port.png
:align: center
:alt: Port
Port in host settings
In the picture below we have setup our port to **5555** so it will be:
* Commands: 5555 (**5555** )
* Subscriber: 5556 (**5555** +1)
* Publisher: 5557 (**5555** +2)
* TTL: 5558 (**5555** +3)
2020-02-20 21:38:15 +08:00
2020-06-22 20:54:18 +08:00
Those four ports needs to be accessible from the client otherwise it wont work at all !