Tunnels
Webrelay also provides public "Tunnels" which allows the creation of secure and reliable connections to your local development environment. This can be particularly beneficial when you need to expose a local server to the internet or establish a connection between local and remote systems.
What is a Tunnel?
In the context of networking, a tunnel is a direct link between two network points, regardless of any intermediate networks. This means you can use tunnels to connect your local machine to the internet without worrying about NAT's, firewalls or other network restrictions. Webrelay tunnels function by exposing a local server (e.g., a web server or a database server) to the internet, or by connecting a local client to a remote server. The tunnel ensures that the connection is secure and reliable, handling all the intricacies of networking, including encryption, routing, and error handling.
Types of Tunnels
Webrelay supports the creation of two types of tunnels: TCP and HTTP.
TCP Tunnels
TCP tunnels are used to expose a local server to the internet. When you create a TCP tunnel, Webrelay gives you a Host and port that you can use to access your local server from anywhere. Here's an example of how to use the Webrelay command-line to create a TCP tunnel:
webrelay tcp -p 5432
In this example, TCP tunnel is established on local port 5432. This can be used to expose a local database running on port 5432 to the internet.
HTTP Tunnels
HTTP tunnels are similar to TCP tunnels, but they are specifically designed to handle HTTP traffic. This makes them ideal for exposing a local web server to the internet. When you create an HTTP tunnel, Webrelay gives you a unique URL that you can use to access your local server from anywhere.
Here's an example of how to create an HTTP tunnel:
webrelay http -p 8080
In this example, the HTTP tunnel is established on local port 8080. This can be used to expose a local web server running on port 8080 to the internet.