A high performance PageKite implementation in C
C C# M4 Python C++ Lua Other
Latest commit b34a672 Mar 1, 2017 @BjarniRunar BjarniRunar Version bump
Failed to load latest commit information.



This is a tight, fast implementation of the PageKite protocol in C, suitable for high-performance or embedded applications.

What is PageKite?

PageKite is a protocol for dynamic, tunneled reverse proxying of arbitrary TCP byte streams. It is particularly well suited for making a HTTP server on a device without a public IP address visible to the wider Internet, but can also be used for a variety of other things, including SSH access.

PageKite is usually used with the public relay service provided by https://pagekite.net/, but you can also run your own relay if you prefer; the Python relay is free software.

For more information, see http://pagekite.org/

What is in the box?

The structure is as follows:

bindings/           Library bindings for Java, Python
contrib/            Things that use libpagekite
doc/                Documentation
include/pagekite.h  The public interface of libpagekite
java-classes/       Compiled Java classes
libpagekite/        The source code
tools/              Helper scripts for building and working

In contrib/backends/ you'll find:

httpkite.c         A sample implementation of a very basic HTTP server
pagekitec.c        Basic standalone pagekite back-end connector/proxy.
sshkite.c          An example of exposing SSH over pagekite.
PageKiteTest.java  Minimal Java test connector

Getting started

To build for development on Linux, use:

$ ./autogen.sh
$ ./configure --prefix=$(pwd)
$ make install

This will build the library, placing binaries in the bin/ and lib/ subdirectories. You can then run the test connector like so:

$ export LD_LIBRARY_PATH=$(pwd)/lib
$ ./bin/pagekitec 80 http yourkite.pagekite.me 0 kitesecret

Or to run the Java test:

$ export LD_LIBRARY_PATH=$(pwd)/lib
$ cd java-classes
$ java PageKiteTest

(Note: The Java test is expected to fail because of hard-coded invalid credentials. You'll need to edit the source for it to actually work.)

Or to run the Python test:

$ export LD_LIBRARY_PATH=$(pwd)/lib
$ cd bindings/python
$ export PYTHONPATH="$(pwd);$PYTHONPATH"
$ python ./cython_demo.py 80 http yourkite.pagekite.me secret

Press CTRL+C to exit any of the test apps.

Documentation and examples

See ./configure --help for some options on how to build the library.

See the old README for hints on how some things used to be done and may still be missing from our current build processes and documentation.

State of the Onion

As of February 2017, the library's main limitations are:

The back-end connector code is however considered mature and stable; the library does a good job connecting, relaying traffic and reconnecting as necessary. Stability has been pretty good, but check our issues for the latest bug reports and the commit log for recent fixes.

License and Copyright

libpagekite is Copyright 2011-2017, The Beanstalks Project ehf.

This code is released under the Apache License 2.0, but may also be used according to the terms of the GNU Affero General Public License. Please see the file COPYING.md for details on which license applies to you.

Commercial support for this code, as well as managed front-end relay service, are available from https://pagekite.net/.

Development of this code was partially sponsored by SURFnet and the Icelandic Technology Development fund.