INTRODUCTION
FEATURES
TUTORIALS
ADVANCED
API
Custom Tunnels
A custom tunnel is used to make a service from your device available for access worldwide via this website.
Examples include:
- Running a webserver on your Raspberry Pi and accessing it worldwide.
- Accessing VNC remote desktop for Rapsberry Pi from anywhere.
- Any other custom project that uses TCP networking.
Custom tunnels are created by entering a command in your Raspberry Pi terminal. The Custom Tunnels page contains a helper button "Create Custom Tunnel" to help you form the correct command to create your tunnel. A full explanation of the different command line options is also available in the Command-Line Options section of this documentation.
The following is a list of example commands for common types of tunnels:
• Creating a http tunnel to a webserver running on localhost port 80:
pitunnel --port=80 --http
• Naming a http tunnel, so that it can be accessed with a subdomain (tunnel_name-<username>.pitunnel.com):
pitunnel --port=80 --http --name=tunnel_name
• Creating a tunnel to a VNC server running on port 5900 of localhost:
pitunnel --port=5900
• Naming the tunnel for easier identification in the tunnel list:
pitunnel --port=5900 --name=vnc
• Creating a tunnel to a http server running on another machine on your network:
pitunnel --host=192.168.1.229 --port=80 --http
• Adding HTTP authentication to a named tunnel at my_server-<username>.pitunnel.com:
pitunnel --port=80 --http --name=my_server --http-auth=<username>:<password>
• Making a tunnel run in the background, and load automatically every time your device powers on:
pitunnel --port=80 --http --persist
(see Persistent Tunnels for more information)
Testing your tunnel
To find out the world-wide accessible address for your custom tunnel, go to the Custom Tunnels page:
The "Available At" column shows either a Hostname and Port Number pair for connecting to your tunnel, or a HTTP address if you used the --http
option.
Named HTTP Tunnels
HTTP tunnels are used when the service you are tunneling to is a web page of some kind.
When you create the tunnel you specify --http
and you'll then get a tunnel address similar to abcd-username.pitunnel.com
, where 'abcd' is randomly generated and changes every hour or so.
On paid plans you can choose what the name is, instead of a randomly generated one, by using the --name
command-line option.
On free plans you can trial naming these tunnels for 14 days.
Static Ports
Non-HTTP tunnels are used for things like SSH, FTP, VNC etc. These tunnels get addresses like uk1.pitunnel.com:12345
.
On free plans the number at the and of this address (called the port number) changes every hour or so.
On paid plans this port number is 'static', which means it is a fixed number that is allocated to your tunnel by the system, and never changes.
Next: Device Alerts