vqp_yw
Last Updated: May 27, 2017
·
9.277K
· poteto
Asd

Share localhost with anyone

Ever wanted to quickly share your localhost server with someone else, without going through the hassle of deploying it somewhere?

You’ll be happy to know that there’s a really simple way to do this. First install the localtunnel gem:

$ gem install localtunnel

Next run your localhost server, for example in Rails, using the default WEBrick server:

$ rails s

Or Python:

$ python - m SimpleHTTPServer 8000

The first time you run localtunnel you’ll need to use one of your public SSH keys:

$ localtunnel -k ~/.ssh/id_rsa.pub 8000

You’ll see something like this in your terminal:

➜  project_name git:(develop) localtunnel 8000
   This localtunnel service is brought to you by Twilio.
   Port 8000 is now publicly accessible from http://xxxx.localtunnel.com ...

Now just share http://xxxx.localtunnel.com with whoever needs to see your work.

Subsequently you can just use localtunnel <port> to generate a public URL:

$ localtunnel 8000

And that’s it. Install and setup takes less than 5 minutes, and it works beautifully.

Say Thanks
Respond

18 Responses
Add your response

6
5d73d3df0df580e6366e79b646aced0b

A very useful tip. Thanks

over 1 year ago ·
59
Friendly kitten icon

Useful tool in many scenarios I imagine, but it's worth noting that while using any server that will let you bind to 0.0.0.0 you can simply set up forwarding rules on your router/firewall and anyone outside your network should be able to reach it. WEBrick does this by default.

over 1 year ago ·
846
4015fc1dc568f855138f29a688e91af8

pagekite.net is even easier

over 1 year ago ·
1451
Pycon logo

to get it work don't forget to install this:

sudo apt-get install ruby ruby1.8-dev rubygems1.8 libopenssl-ruby
over 1 year ago ·
1757
Greg cardoni picture medium

Also check out: http://xip.io/ (Created by 37 Signals)

over 1 year ago ·
2472
Oliver montes devopensource

awesome thx!!

over 1 year ago ·
2731
Jze

Very useful!! Thnx :D

over 1 year ago ·
2780
Id

That's nice ! But why python in tags ? all is ruby tools

over 1 year ago ·
3512
D7779435ee3a8b8dff22ce22446a7678

Thank you so much.

over 1 year ago ·
3689
Headphones200

Great tip!

over 1 year ago ·
4604
97113f00f49fafd72811b5d892bd68a8

Deff using this.

over 1 year ago ·
4605
97113f00f49fafd72811b5d892bd68a8

@gahtune localtunnel supports python

over 1 year ago ·
5170
Cb05f0c37139db9ad3f8a8a632c653d6

Awesome tip! gonna give this a go

over 1 year ago ·
5636
8f13480c678e581504174c0fd1235fef

here's another one https://forwardhq.com/

over 1 year ago ·
9051

xip.io only works on a local network

over 1 year ago ·
10022
Am

If you are on the same network you can just take his IP adress and put it on your .htaccess (Allow from xxx.xxx.xxx.xxx)
Then he can go on your IP address and see your loacalhost

over 1 year ago ·
13052
Ec61d4d2928411e280a722000aaa08b2 7

localtunnel github readme: "This project is currently down. Please use Ngrok."

over 1 year ago ·
14784
64bfb8c39d88674aaa911dc3750531d0

ngrok is even easier

over 1 year ago ·