Migrating from Serveo to Packetriot
Published at August 28, 2019 · 4 min read
Share on:Serveo is another tool that enables you to expose a local server to the Internet. It’s been freely available for several years and it uses a clever method of using the ssh client available on Linux/Unix distributions to establish a reverse tunnel. There’s no software or client to install, brilliant.
You might be considering using an alternative to Serveo, like Packetriot, because you need more features than what’s available with the ssh client. We’ll walk through migrating your setup using the basic Serveo use-case as an example and translating it to how it would be done with the pktriot client.
Expose a Local NodeJS Server
Let’s assume you’re running a Node server locally and it’s listening on port 3000. You want to expose to the Internet with Serveo so you can share it with colleagues. You would do the following to forward traffic from the Internet to it.
ssh -R 80:localhost:3000 serveo.net
Forwarding HTTP traffic from
https://abc.serveo.net
This wasy quick and easy.
Migrating to Packetriot
Serveo is user-less and client-less, which makes it flexible and quick to use. Packetriot requires user registration and has it’s own client. For these extra steps you get more features like firewalling access to your tunnel, a client that can serve both static content and proxy to an upstream server, automatic management of your Let’s Encrypt certificates, and more. One Packetriot tunnel can serve X number of websites and servers behind it.
You’ve registered, next download the client for your operating system. Put the binary in a path so it’s easier to use, e.g. /usr/local/bin, ~/bin. Note: there’s a README.md with many scenarios documented, check it out :)
Our example will follow the typical Serveo use-case, intermittent use/need of the tunnel and exposing traffic to a locally running Node server listening on port 3000.
First we need to authenticate, create and configure a tunnel. We’ll instruct the client to create our config file in our home directory /home/user/.pktriot
.
[user@host:] pktriot configure
Choose a path to the configuration file:
[1] /etc/pktriot/config.json
[2] /data/config.json
[3] /home/user/.pktriot/config.json
Input selection [#]: 3
Authenticate this client by visiting this URL:
https://packetriot.com/client/identauth/4e61e6c1c40c236c57...
Identified and authenticated!
Choose the region for the edge server to connect to:
+------------------------+
| # | Region |
+------------------------+
| 1 | us-east |
+------------------------+
| 2 | us-west |
+------------------------+
| 3 | eu-central |
+------------------------+
| 4 | asia-southeast |
+------------------------+
Input selection [#]: 1
Visit the authentication URL, you’ll have to login, perhaps twice, this all meant to verify the person visiting the URL is actually the user. Once you visit the URL the client will automatically receive an Auth token and we’re done with this part. Choose a region closer to you for better performance.
You only need to configure once on a system, unless you need more tunnels. From here it’s all about HTTP/S and TCP routing rules and restarting your tunnel between rule changes.
Each tunnel is assigned a hostname, you can print out the details using the info
command. You can create any number of sub-domains with the hostname you’re assigned and HTTPS is available.
[user@host:] pktriot info
Client:
Hostname: damp-water-68304.pktriot.net
Server: us-east-65319.packetriot.net
IP: 159.203.126.35
Final step, let’s create the routing rule to send traffic from the Internet to the local Node server. We’ll enable TLS, secure-redirect, and we’ll use a subdomain as well. After we create the rule for the Node server, we can then start the tunnel.
[user@host:] pktriot tunnel http add --domain nodejs.damp-water-68304.pktriot.net \
--destination 127.0.0.1 --http 3000
# print out a table with all the rules
[user@host:] pktriot info
[user@host:] pktriot start
Important note, you will need to restart the tunnel when you change any traffic routing rules.
Your tunnel will be available after you start
it up. It there are any network failures it will auto-reconnect to the server.
Thanks For Considering Us!
Thanks for checking Packetriot as an alternative to Serveo. This post is just scratching the surface for what you can do with our client and service but I hope it helps make your migration easier.
Have any feedback or comments? Please tweet or DM on Twitter. Or just contact us via email.
Cheers!
The Packetriot team