Guide to Deploying the Pinggy Reverse Proxy Service in ServBay
Pinggy is an easy-to-use tool for tunneling through firewalls and NAT. By utilizing reverse proxy technology, it allows you to securely expose your local services to the internet. This guide details how to use Pinggy in the ServBay environment to quickly enable internet access to local web services.
Technical Principles
Pinggy establishes a secure SSH tunnel to map local services deployed behind NAT/firewalls to the public internet. In the context of ServBay, this allows developers to easily publish their locally debugged web services in real-time, facilitating team collaboration, remote testing, and demonstrations.
Environment Setup
No client installation required! One of Pinggy's greatest advantages is that it does not require any software to be installed on the local computer. You only need a terminal that supports SSH.
Tunnel Configuration Practical
Core Commands
Establishing a tunnel with Pinggy is very straightforward. Just execute the following command in your terminal:
ssh -p 443 -R0:localhost:443 -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -t [email protected] x:localServerTls:servbay.new "u:host:servbay.new"
Parameter Component | Function Description |
---|---|
-p 443 | Specifies the port for SSH connection to the Pinggy server as 443 (default HTTPS port). |
-R0:localhost:443 | Remote port forwarding. 0 means the Pinggy server will automatically assign a random port. localhost:443 indicates that the remote port is forwarded to the local port 443 (HTTPS). |
-o StrictHostKeyChecking=no | Disables SSH host key check (convenient for initial connections or testing, but not recommended in production environments). |
-o ServerAliveInterval=30 | Sends a keep-alive message every 30 seconds to keep the SSH connection active. |
-t [email protected] | User name and server address for Pinggy. |
x:localServerTls:servbay.new | Custom parameters for Pinggy, specifying the TLS domain name of the local server as servbay.new . |
"u:host:servbay.new" | Custom parameters for Pinggy, setting the Host header of incoming requests to servbay.new . |
Once the command runs successfully, it will output the URL to access your service:
http://rnirh-172-188-50-148.a.free.pinggy.link
https://rnirh-172-188-50-148.a.free.pinggy.link
2
Service Verification
- Verify with
curl
(recommended): Use thecurl
command to test.
curl -I https://rnirh-172-188-50-148.a.free.pinggy.link
The output will be:
HTTP/1.1 200 OK
Connection: close
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: max-age=0, must-revalidate, no-cache, no-store, private
Connection: keep-alive
Content-Type: text/html; charset=UTF-8
Date: Tue, 18 Feb 2025 11:51:48 GMT
Expires: Sun, 02 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: nginx
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN
X-Powered-By: PHP/8.4.3
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Browser Access: Simply open a browser and visit
https://rnirh-172-188-50-148.a.free.pinggy.link
Expected Results:
- Display web content consistent with the local ServBay service.
- If your local service is configured with HTTPS, Pinggy will automatically support HTTPS.
- Response times are generally quick (depending on your local network and the connection to the Pinggy server).
Advanced Techniques
Custom Domain Names: Pinggy Pro users can use custom domain names. Refer to the Pinggy documentation for more details.
TCP Tunneling: If your service is not HTTP/HTTPS, you can use Pinggy’s TCP tunneling feature:
bashssh -R <REMOTE_PORT>:localhost:<LOCAL_PORT> a.pinggy.io
1Replace
<REMOTE_PORT>
with the port you want to use on the Pinggy server.Persistent Tunneling (using
autossh
): If your network is unstable, or you want to keep the tunnel open for extended periods, it is recommended to useautossh
.autossh
will automatically reconnect after SSH disconnection.
Troubleshooting
Phenomenon | Solution |
---|---|
Connection timeout | Check that the ServBay service is running and that <LOCAL_PORT> is correct. |
404 Error (Not Found) | If using a virtual host, ensure you used the curl command with the correct Host header as instructed in the “Configuration Examples.” |
Unable to Access Pinggy URL | Check your network connection to ensure you can access a.pinggy.io . |
Intermittent Disconnections | This may be due to an unstable network. Try using autossh to create a more stable connection (see the “Advanced Techniques” section). |
Summary of the Solution
With Pinggy, developers can easily and quickly establish a secure public access channel in the ServBay environment. This solution has the following advantages:
- No Client Installation Required: Simplifies the configuration process and reduces dependencies.
- One-Click Operation: A single SSH command can launch the tunnel.
- Automatic HTTPS Support: No manual SSL certificate configuration needed.
- Supports HTTP and TCP Tunneling: Meets various types of service needs.
- Token-less Commands: URLs can be shared directly without the worry of token leakage.
Pinggy offers a more convenient alternative to Ngrok, especially suitable for rapid testing and temporary sharing of local services. For scenarios requiring long-term stable operation or custom domain names, consider Pinggy's Pro version.