diff --git a/example/.gitignore b/example/.gitignore
new file mode 100644
index 0000000..8ed876c
--- /dev/null
+++ b/example/.gitignore
@@ -0,0 +1,2 @@
+build/
+.waf*
diff --git a/example/client.cc b/example/client.cc
new file mode 100644
index 0000000..279d260
--- /dev/null
+++ b/example/client.cc
@@ -0,0 +1,72 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Alexander Afanasyev
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include <ndn.cxx.h>
+#include <iostream>
+
+using namespace std;
+
+const char *FILENAME = NULL;
+ndn::Name InterestBaseName;
+
+// create a global handler
+ndn::Wrapper handler;
+
+void OnData (ndn::Name name, ndn::PcoPtr pco);
+void OnTimeout (ndn::Name name, const ndn::Closure &closure, ndn::InterestPtr origInterest);
+
+void OnData (ndn::Name name, ndn::PcoPtr pco)
+{
+  ndn::BytesPtr content = pco->contentPtr ();
+  cout << string ((char*)ndn::head (*content), content->size ());
+
+  int seqnum = ndn::Name::asSeqNum (*name.rbegin ());
+  if (seqnum >= 10)
+    {
+      return;
+    }
+
+  cerr << ">> C++ " << ndn::Name (InterestBaseName).appendSeqNum (seqnum + 1) << endl; // a shortcut to construct name
+  handler.sendInterest (ndn::Interest ()
+                        .setName (ndn::Name (InterestBaseName).appendSeqNum (seqnum + 1))
+                        .setScope (ndn::Interest::SCOPE_LOCAL_HOST),
+                        ndn::Closure (OnData, OnTimeout));
+}
+
+void OnTimeout (ndn::Name name, const ndn::Closure &closure, ndn::InterestPtr origInterest)
+{
+  // re-express interest
+  handler.sendInterest (*origInterest, closure);
+}
+
+int
+main (int argc, char **argv)
+{
+  if (argc < 2)
+    {
+      std::cerr << "You have to specify filename as an argument" << std::endl;
+      return -1;
+    }
+  
+  // this code does not check for most of the bad conditions
+  FILENAME = argv[1];
+
+  InterestBaseName = ndn::Name ("/my-local-prefix/simple-fetch/file");
+  InterestBaseName.append (FILENAME);
+
+  cerr << ">> C++ " << ndn::Name (InterestBaseName).appendSeqNum (0) << endl;
+  handler.sendInterest (ndn::Interest ()
+                        .setName (ndn::Name (InterestBaseName).appendSeqNum (0))
+                        .setScope (ndn::Interest::SCOPE_LOCAL_HOST),
+                        ndn::Closure (OnData, OnTimeout));
+
+  sleep (3);
+  return 0;
+}
diff --git a/example/server.cc b/example/server.cc
new file mode 100644
index 0000000..1a62f20
--- /dev/null
+++ b/example/server.cc
@@ -0,0 +1,45 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Alexander Afanasyev
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include <ndn.cxx.h>
+#include <iostream>
+
+using namespace std;
+
+ndn::Name InterestBaseName;
+
+// create a global handler
+ndn::Wrapper handler;
+
+void OnInterest (ndn::InterestPtr interest)
+{
+  cerr << interest->getName () << endl;
+  
+  static int COUNTER = 0;
+
+  ostringstream os;
+  os << "C++ LINE #" << (COUNTER++) << endl;
+  
+  handler.publishData (interest->getName (), os.str (), 5);
+}
+
+int
+main (int argc, char **argv)
+{
+  InterestBaseName = ndn::Name ("ccnx:/my-local-prefix/simple-fetch/file");
+
+  handler.setInterestFilter (InterestBaseName, OnInterest);
+  
+  while (true)
+    {
+      sleep (1);
+    }
+  return 0;
+}
diff --git a/example/waf b/example/waf
new file mode 100755
index 0000000..f26d925
--- /dev/null
+++ b/example/waf
Binary files differ
diff --git a/example/wscript b/example/wscript
new file mode 100644
index 0000000..c617d47
--- /dev/null
+++ b/example/wscript
@@ -0,0 +1,66 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+VERSION='0.1'
+APPNAME='test-project'
+
+from waflib import Build, Logs, Utils, Task, TaskGen, Configure
+
+def options(opt):
+    opt.load('compiler_c compiler_cxx boost ccnx')
+
+def configure(conf):
+    conf.load("compiler_c compiler_cxx ccnx")
+
+    conf.add_supported_cxxflags (cxxflags = ['-O0',
+                                             '-Wall',
+                                             '-Wno-unused-variable',
+                                             '-g3',
+                                             '-Wno-unused-private-field',
+                                             '-fcolor-diagnostics',
+                                             '-Qunused-arguments'
+                                             ])
+
+    if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
+        libcrypto = conf.check_cc(lib='crypto',
+                                  header_name='openssl/crypto.h',
+                                  define_name='HAVE_SSL',
+                                  uselib_store='SSL')
+    else:
+        conf.define ("HAVE_SSL", 1)
+    if not conf.get_define ("HAVE_SSL"):
+        conf.fatal ("Cannot find SSL libraries")
+
+    conf.check_ccnx (path=conf.options.ccnx_dir)
+    conf.check_cfg(package='libndn.cxx', args=['--cflags', '--libs'], uselib_store='CCNXCPP', mandatory=True)
+
+    conf.load('boost')
+    conf.check_boost(lib='system test iostreams filesystem thread')
+
+def build (bld):
+    bld (
+        features = ["cxx", "cxxprogram"],
+        target = "client",
+        source = "client.cc",
+        use = 'BOOST BOOST_THREAD CCNX CCNXCPP',
+        )
+
+    bld (
+        features = ["cxx", "cxxprogram"],
+        target = "server",
+        source = "server.cc",
+        use = 'BOOST BOOST_THREAD CCNX CCNXCPP',
+        )
+
+@Configure.conf
+def add_supported_cxxflags(self, cxxflags):
+    """
+    Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
+    """
+    self.start_msg('Checking allowed flags for c++ compiler')
+
+    supportedFlags = []
+    for flag in cxxflags:
+        if self.check_cxx (cxxflags=[flag], mandatory=False):
+            supportedFlags += [flag]
+
+    self.end_msg (' '.join (supportedFlags))
+    self.env.CXXFLAGS += supportedFlags
