Services
A service is any application or program that is actively running and tied to a specific TCP port. This encompasses a vast array of applications, including, but not limited to, HTTP servers, email servers, databases (e.g., PostgreSQL), and many more.
Defining a Service
To define a service, you'll need to use the webrelay service start
command. This command communicates to Webrelay that you're running a certain type of service bound to a specific TCP port.
Here is the basic format of the command:
webrelay service start -n <servicename> -p <port> -t <protocol>
Here is an example:
webrelay service start -n mydatabase -p 5432 -t tcp
In the above command:
-n mydatabase
tells Webrelay to assign the name "mydatabase" to this service.-p 5432
indicates that the service is running on TCP port 5432.-t tcp
specifies the protocol used by the service, in this case, TCP, You can use tcp or http.
Additional Options
-l
or--lifetime
- The lifetime of the service, after which the service will be stopped. The default value is 24 hours.-u
or--upstream
- The upstream host, defaults to localhost--user
- The user who will be able to access the service, defaults to the current user--group
- The group who will be able to access the service
Listing Services
Running services can be listed using the webrelay service list
command. This command will list all the services running on your network
Connecting to a service
Once a service has been defined and is running on your network, it can be accessed from anywhere using the Webrelay CLI. This makes your service reachable from any location, greatly simplifying remote access and management. The ability to remotely access services in this way opens up a range of possibilities for remote development and access. For example, a developer can interact with a database or application server running on their home machine from a remote location, or services running on different machines can interact with each other as if they were on the same local network.
To connect to the service you must use the webrelay client
command. and the same user must be logged in on both machines.
Security Considerations
Defining a Webrelay service does not make the service accessible to the public internet. Neither does ity open any ports on your firewall, you don't need any additional network rules configured to access the service.
Note that even with this guarantee it's crucial to ensure these services are secure. Always follow best practices for securing your services, such as using strong authentication mechanisms and enabling strong encryption wherever possible