By Daniel Ramirez.
An important thing through the Software Development Cycle is the feedback a developer gets during or after iteration. He/she gets all kinds of it, from internal things such as code, to all the way up to what’s shown to the end users.
Feedback is important
In any kind of work, I believe we should always look for some kind of feedback. Feedback does not necessarily means you have done things the wrong way, it can help you see how other people see your work, and lets you know if they understood correctly the idea behind it.
Feedback lets you know if things can be improved, motivates you to continue your work. If you get an email saying "Amazing work!", "Your strategy is going correct!", or a simple "+1!" it certainly - correct me if I'm wrong - makes your day and makes you feel valuable. I'd like to believe you learn you did it correctly and will make it again like that, or even challenge you to improve it.
But how do we get feedback? We just ask. "How are we doing?", "Is this how you visualized it?".
If you've got doubts, ask. The ways to get feedback are endless. For instance we could do a survey, a poll on Facebook, or ask a question on Quora, or discussing it on Convore.
Tunneling is simple
Now what about tunneling?
At its core, tunneling is creating a channel of bidirectional communication between two endpoints, carrying a payload/data inside. For example I'd like to access a remote machine's port by accessing a my local machine port, let’s say I want to connect to MySQL 3306 port, but it has been blocked by the firewall. By using SSH, I could establish port forwarding and then connect to my local port.
It is basically a simple command, ssh. It is available via the openssl package in unix boxes Or downloading Bash for windows. Don't know if there is any kind of native port redirection in PowerShell though.
Anyway, to link a local port to a remote port on a server it is done by the following command:
ssh -f -L {localport}:{remotehost}:{remoteport}
Exposing a port is even simpler
What do Tunneling and Feedback have in common? Well, a few months back I discovered showoff.io, and then another Open source service called localtunnel, developed by Twilio. They both make it easy to share our web development progress to the world, and get feedback.
If we would like to show a friend, or a client our progress on development it should be easy. There are some times where a proper dedicated dev box is a better solution, but for instant feedback, seeking confirmation on certain things, this could help. There is no need to go through all the dev build hassle just to show a change.
In both services, it is just a simple as a:
$ gem install localtunnel -- Just once to install it.
$ localtunnel 8080
This will generate a random subdomain of the service which is publicly accessible to the people you share it with.
The only drawback of this is this requires Ruby; however a few days ago I ported it to c# and created a console and a UI file. So feel free to try it out.
Under the hood
You could just read the code, but the client basically does this few things:
1. The service listens for the 80 port,
2. A request for a tunnel is made
a. The ssh public key for authentication is registered on the machine
b. A subdomain is randomly generated
c. A server port is opened, which will be the one connected to the developer's machine.
3. Localtunnel's client now creates a ssh tunnel with forwarding from the developer's localport to the open port
4. Now when a request is made to the subdomain, the service will catch it, identify the tunnel it has associated and redirect the packets.
The server is also hosted on the localtunnel’s repo, if you would like to set up your own. It requires Python + Twisted lib.