where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network.
where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network.
**note:** Sphinx client uses HTTP to communicate with **sphinx-relay**. Since setting up SSL on a local network is problematic (you don't have any domain names to authenticate with certificates), you have to rely on your local network security. Below is an example of how Sphinx/sphinx-relay communications look like in **tcpdump**:
*Message payloads are encrypted with **sphinx cypher**, but all metadata is transmitted in cleartext.*
#### If you want to connect to your Sphinx-Relay from outside of your local network
#### If you want to connect to your Sphinx-Relay from outside of your local network
**note:** it is recommended to use SSL encryption for any communications between **Sphinx** and **sphinx-relay** outside of a trusted network. [**Docker deployment guide**](docs/docker-deployment.md) sets up SSL encryption for you automatically, you only have to obtain your domain and certificates. If you still want to set up **sphinx-relay** manually, the instructions to set up the SSL are below.
where `x.x.x.x` is the permanent public IP address of your router.
where `x.x.x.x` is the permanent public IP address of your router.
> Make sure that port 3001 forwarding is properly set up.
Make sure that port 3001 forwarding is properly set up.
For extra security:
For extra security:
```sh
```sh
$ export USE_PASSWORD=true
$ export USE_PASSWORD=true
```
```
As noted in the previous section, you might want to protect communications between your Sphinx client and **sphinx-relay** with SSL.
In order to do that, obtain a domain and an SSL certificate for your **sphinx-relay** server and set up a reverse proxy with NGINX (or a more lightweight alternative).
We recommend using Let's Encrypt service to obtain a free SSL certificate and [**acme.sh**](https://acme.sh) for setting it up and renewals.
To configure NGINX as an SSL reverse proxy:
```sh
$ sudo apt install nginx
sudo nano /etc/nginx/sites-available/YOUR-DOMAIN
```
Use the following NGINX config:
```
server {
listen 53001 ssl;
server_name YOUR-DOMAIN;
# Edit the above _YOUR-DOMAIN_ to your domain name
} # Don't leave this out! It "closes" the server block we started this file with.
```
Save and exit:
`Ctrl + X`
`Y`
`Enter`
To make the file active, we will need to link the file in the sites-available folder to a location within the sites-enabled folder. Again, change YOUR-DOMAIN here with the actual name of the file you created earlier.