Tag Archive: proxy

The Charm of localtunnel

This is something so awesome that i can’t fail to share it with everyone. 😀
So, I’m working on this Django site but how do i show my friend who is like miles away sitting in his/her home about what i’m working on.. So, i got to know about this awesome stuff called localtunnel.

Localtunnel allows you to easily share a web service on your local development machine without messing with DNS and firewall settings.

Localtunnel will assign you a unique publicly accessible url that will proxy all requests to your locally running webserver.


Localtunnel command line script allows you to manually setup a sharing tunnel to a local webserver.

npm install -g localtunnel

Start a webserver on some local port (in our example we have a server running on port 8000).

Make sure everything is working locally first by visiting http://localhost:8000.

Now use the command line app to request a tunnel to your local server.

$ lt --port 8000
your url is: https://gqgh.localtunnel.me

You can now share https://gqgh.localtunnel.me with anyone. As long as your local instance of lt is running, this url will remain active. Any requests to that url will be routed to your service on port 8000.

When you start and stop your tunnel, you will see it reflected in the active tunnel count below.

And that’s it. Your site is running locally on your system but is tunneled via a proxy server. So, anyone all around the world can vies your site till you keep your local server running 😉

Many Hackers use this theory to channel their local servers to bounce around all over making it difficult to trace back. Pretty cool.. ain’t it? 😉



Ubuntu Proxy settings

Ubuntu Settings proxy or maybe un-setting 😉 from terminalUbuntu 12.04

I’ve had this trouble when I’m in college the system took my college lan address as the default proxy setting and i was happy to apply that system wide 😛 but then i came back home and my broadband connection got connected. I could firefox and github and everything. But the problem started when i wanted to download something and proxy was searching for my college address. Now that’s irritating. So I did some research and came up with a solution. Here’s the solution. 😉 Cause i like to share.

Ubuntu 12.10 will set proxy settings both in /etc/environment and /etc/apt/apt.conf when you set proxy from GUI (Network Settings).

Check your apt settings

grep -Hnri proxy /etc/apt/

will list out the current proxy settings used by apt in the following format.


If you see any output, it corresponds to apt‘s proxy settings. They will have to be cleared.

sudoedit <filename>

will allow you to edit the corresponding configuration file. Copy the existing contents somewhere in case you need to restore them, and delete or comment the lines that look like
Acquire::<protocol>::proxy=<your proxy here>
(Add // at the beginning of a line to comment that line. Commented lines are ignored.)

Save the files, close the text editor, and retry. If the problem persists,

Check global default environment.

grep proxy -i /etc/environment

Should list any proxy settings that are applied globally. If you need to clear them,

sudoedit /etc/environment

will fire up the text editor. Lines that start with # will be ignored, so add a # before those lines that mention your proxy settings. Save the file and retry.

Cleaning the user environment

It is possible that the systemwide configuration is clean but apt is picking up proxy settings from the user’s environment. sudoin certain configurations by default, or when explicitly passed -E as an option, preserves the environment.

env | grep -i proxy

should list out any current environment proxy settings. unset <variable> can be used to unset or clear a variable. Unset all <protocol>_proxy variables. If they are automatically being set, you might comment out the corresponding entries from ~/.profile, ~/.bashrc, ~/.pam_environment

(Those are the most common files that contain the entries. All of them can be searched at once using grep -Hni proxy ~/.profile ~/.bashrc ~/.pam_environment )

%d bloggers like this: