the fast, reliable localhost tunneling solution


Web Development on Localhost

By Bjarni RĂșnar Einarsson 2012-07-14, 13:47

Note: This page is a work in progress. It documents the upcoming 0.4.7 release, and some features are not available in older versions.

This page collects in one place tips and tricks for web developers who are using PageKite.

The Basics

Downloading the program and then running this:

$ pagekite.py 80 NAME.pagekite.me

... will make the web server on port 80 visible to the public Internet, by relaying traffic through one of the pagekite.net front-end reverse proxies.

For working with static content, you can also share a folder full of files:

$ pagekite.py /path/to/folder NAME.pagekite.me +indexes

The idea is, you run the program to expose your content for peer review or testing and turn it off (close the window or press CTRL+C) when you are done.

What makes PageKite different?

There are a few other programs out there which allow web developers to expose their local services and works in progress. However, most of them lack one or more of the following features which make PageKite better for serious developers:

  • Unlimited, persistent DNS names for your work
  • The ability to use your own DNS name
  • Redundant relay servers in 3 continents make us fast and reliable
  • Zero-install SSL encryption for your work

Read more about our features here.

The Host header

The pagekite.net relay servers expose many hosts to the Internet using a single IP, in very much the same way as shared hosting services. Just like with such shared hosting, this depends on the HTTP/1.1 Host header (or the SNI extension for incoming HTTPS connections) - the browser specifies which host it wants to connect to in the initial request and that data is used to route the request over a tunnel to your local web server.

This has implications for how your local web server should be configured. If it is only configured to accept requests on localhost or something.dev, then your content will not become immediately visible on the project.pagekite.me name, even if the connection is up and running.

There are two ways to solve this - one is to configure your local web server to recognize your public project.pagekite.me name. This is the recommended strategy.

The other is to ask pagekite.py to rewrite the incoming Host header to match your local configuration, like so:

$ pagekite.py 80 NAME.pagekite.me +rewritehost=project.dev

Note that this only rewrites the incoming Host header, it does not edit the HTML content itself, so any absolute URLs may still cause problems. A notable example of software which has this problem is the ever-popular Wordpress.

Managing your kites

Add/remove/list/disable

Security

Basic encryption, passwords, IP restrictions

Advanced Topics

Using your own domain

Custom ports, custom names

Websockets and Flash sockets

Watching the traffic flow

Scripting PageKite

Tunneling SSH

Comments

None yet, you can be first!

Leave a comment

( (Please leave these blank: )

We use Gravatar for commenter's photos. Get your own, it's free!