DEV Community

abhishekq61
abhishekq61

Posted on • Edited on • Originally published at Medium

1

Debug#Host Servers on your localhost

Disclaimer: I am author from Staqlab Tunnel.This blog contains reference to services provided by tunnel-staqlab.
Do give me a thumbs up, if you find this blog useful

One of the major part of coder life is testing.When it comes to stand-alone consoles apps the testing is pretty easy.You just hook up some debug breakpoints in your favourite IDE and hit the debug button and vola you could see all the variables and inspect your code right-in where you placed your breakpoint.

But what if you rely on some external services to get your code working...

As for example, most of the REST/HTTP applications contains webhook routes from external services as a major part of the workflow.

You just want requests from these services to be forwarded to your localhost!!! But wait what, is this possible?
Can your localhost be connected over to the internet and traffic from web is forwarded to your local machine?

Yes this is possible through principles of SSH Tunneling.
There are already tunnels servers like Staqlab Tunnel which forwards traffic from web to your localhost.

The guide on staqlab is pretty self-explanatory. However lets discuss step-by-step procedure here also.
I will assume your server is running on localhost:3000
At the end of this tutorial you will be able to get a public url, which points to server running locally on port 3000.Do mind that the port can be any valid port.It doesn't necessarily be 3000

Step 1:

Download tunnel client for you pc from https://tunnel.staqlab.com/downloads

Step 2:

Go to your downloads folder and unzip the zip file downloaded

Step 3:

Open terminal and navigate to folder where you have placed the downloaded file. and paste below command
./staqlab-tunnel 3000
if you want to have a custom domain.Look, its also possible.Replace above command with below command.
./staqlab-tunnel 3000 hostname=<your-domain>
e.g
./staqlab-tunnel 3000 hostname=kitty-lovers

After following above steps, you will be greeted with 3 urls on your terminal window.

First one, is inspector url. Its a powerful tool where you can investigate and replay all the http/https traffic from/to your server

The second and third url are http and https versions of the the public url which is in this case is

Just copy this url and paste it in your browser and see the magic, you can
see response from your pc on the your browser window.


Share this url with your colleagues, and display your work over the web!!

Redis image

Short-term memory for faster
AI agents

AI agents struggle with latency and context switching. Redis fixes it with a fast, in-memory layer for short-term context—plus native support for vectors and semi-structured data to keep real-time workflows on track.

Start building

Top comments (2)

Collapse
 
hkchakladar profile image
hkchakladar

Not working, not getting public link, terminal stuck on initiating connection for hours like this:

$ ./staqlab-tunnel 5000
Inspector Client---->  https://tunnel.staqlab.com/inspector/4000/details
For any issues, recommendations or feature request mail us at admin@staqlab.com

Mail us at admin@staqlab.com to make recommendations or feature request and win $5 if its get accepted.

Buy us a coffee, if you liked the work : https://www.patreon.com/staqlab
Initiating Connection...
CAUTION: we have updated .tunnel.staqlab.com to .staqlab-tunnel.com You may need to update your webhook url if you have registered it with some 3rd party integration
Enter fullscreen mode Exit fullscreen mode
Collapse
 
virgin2378hybrid profile image
virgin2378-hybrid

this tunnel is not working for me but i still keep it
maybe one of this days'it might decide to work, who knows'i need to be kind too......

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Discover fresh viewpoints in this insightful post, supported by our vibrant DEV Community. Every developer’s experience matters—add your thoughts and help us grow together.

A simple “thank you” can uplift the author and spark new discussions—leave yours below!

On DEV, knowledge-sharing connects us and drives innovation. Found this useful? A quick note of appreciation makes a real impact.

Okay