diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..0b8f2ee
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "websocketpp"]
+    path = websocketpp
+    url = https://github.com/zaphoyd/websocketpp.git
diff --git a/.waf-tools/websocket.py b/.waf-tools/websocket.py
new file mode 100644
index 0000000..2c500c7
--- /dev/null
+++ b/.waf-tools/websocket.py
@@ -0,0 +1,77 @@
+# encoding: utf-8
+
+from waflib import Options, Logs, Errors
+from waflib.Configure import conf
+
+import re
+
+def addWebsocketOptions(self, opt):
+    opt.add_option('--without-websocket', action='store_false', default=True,
+                   dest='with_websocket',
+                   help='Disable WebSocket face support')
+setattr(Options.OptionsContext, "addWebsocketOptions", addWebsocketOptions)
+
+@conf
+def checkWebsocket(self, **kw):
+    if not self.options.with_websocket:
+        return
+
+    isMandatory = kw.get('mandatory', True)
+
+    self.start_msg('Checking for Websocket includes')
+
+    try:
+        websocketDir = self.path.find_dir('websocketpp/websocketpp')
+        if not websocketDir:
+            raise Errors.WafError('Not found')
+
+        versionFile = websocketDir.find_node('version.hpp')
+        if not websocketDir:
+            raise Errors.WafError('Corrupted: Websocket version file not found')
+
+        try:
+            txt = versionFile.read()
+        except (OSError, IOError):
+            raise Errors.WafError('Corrupted: cannot read Websocket version file')
+
+        # Looking for the following:
+        # static int const major_version = 0;
+        # static int const minor_version = 3;
+        # static int const patch_version = 0;
+
+        version = [None, None, None]
+
+        majorVersion = re.compile('^static int const major_version = (\\d+);$', re.M)
+        version[0] = majorVersion.search(txt)
+
+        minorVersion = re.compile('^static int const minor_version = (\\d+);$', re.M)
+        version[1] = minorVersion.search(txt)
+
+        patchVersion = re.compile('^static int const patch_version = (\\d+);$', re.M)
+        version[2] = patchVersion.search(txt)
+
+        if not version[0] or not version[1] or not version[2]:
+            raise Errors.WafError('Corrupted: cannot detect websocket version')
+
+        self.env['WEBSOCKET_VERSION'] = [i.group(1) for i in version]
+
+        # todo: version checking, if necessary
+
+        self.end_msg('.'.join(self.env['WEBSOCKET_VERSION']))
+
+        self.env['HAVE_WEBSOCKET'] = True
+        self.define('HAVE_WEBSOCKET', 1)
+
+    except Errors.WafError as error:
+        if isMandatory:
+            self.end_msg(str(error), color='RED')
+            Logs.warn('If you are using git NFD repository, checkout websocketpp submodule: ')
+            Logs.warn('    git submodule init && git submodule update')
+            Logs.warn('Otherwise, manually download and extract websocketpp library:')
+            Logs.warn('    mkdir websocketpp')
+            Logs.warn('    curl -L -O https://github.com/zaphoyd/websocketpp/archive/0.3.0-alpha4.tar.gz')
+            Logs.warn('    tar zxf 0.3.0-alpha4.tar.gz -C websocketpp/ --strip 1')
+            Logs.warn('Alternatively, Websocket support can be disabled with --without-websocket')
+            self.fatal("The configuration failed")
+        else:
+            self.end_msg(str(error))
diff --git a/core/face-uri.cpp b/core/face-uri.cpp
index 1b2092c..2969e20 100644
--- a/core/face-uri.cpp
+++ b/core/face-uri.cpp
@@ -112,6 +112,14 @@
   m_port = boost::lexical_cast<std::string>(endpoint.port());
 }
 
+FaceUri::FaceUri(const boost::asio::ip::tcp::endpoint& endpoint, const std::string& scheme)
+  : m_scheme(scheme)
+{
+  m_isV6 = endpoint.address().is_v6();
+  m_host = endpoint.address().to_string();
+  m_port = boost::lexical_cast<std::string>(endpoint.port());
+}
+
 #ifdef HAVE_UNIX_SOCKETS
 FaceUri::FaceUri(const boost::asio::local::stream_protocol::endpoint& endpoint)
   : m_isV6(false)
diff --git a/core/face-uri.hpp b/core/face-uri.hpp
index 487f8f8..94474c7 100644
--- a/core/face-uri.hpp
+++ b/core/face-uri.hpp
@@ -79,6 +79,9 @@
   explicit
   FaceUri(const boost::asio::ip::udp::endpoint& endpoint);
 
+  /// construct tcp canonical FaceUri with customized scheme
+  FaceUri(const boost::asio::ip::tcp::endpoint& endpoint, const std::string& scheme);
+
 #ifdef HAVE_UNIX_SOCKETS
   /// construct unix canonical FaceUri
   explicit
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
new file mode 100644
index 0000000..db7fdc0
--- /dev/null
+++ b/daemon/face/websocket-channel.cpp
@@ -0,0 +1,127 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "websocket-channel.hpp"
+#include "core/face-uri.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("WebSocketChannel");
+
+using namespace boost::asio;
+
+WebSocketChannel::WebSocketChannel(const websocket::Endpoint& localEndpoint)
+  : m_localEndpoint(localEndpoint)
+  , m_isListening(false)
+{
+  // Setup WebSocket server
+  m_server.clear_access_channels(websocketpp::log::alevel::all);
+  m_server.clear_error_channels(websocketpp::log::alevel::all);
+
+  m_server.set_message_handler(bind(&WebSocketChannel::handleMessage, this, _1, _2));
+  m_server.set_open_handler(bind(&WebSocketChannel::handleOpen, this, _1));
+  m_server.set_close_handler(bind(&WebSocketChannel::handleClose, this, _1));
+  m_server.init_asio(&getGlobalIoService());
+
+  this->setUri(FaceUri(localEndpoint, "ws"));
+}
+
+WebSocketChannel::~WebSocketChannel()
+{
+}
+
+void
+WebSocketChannel::handleMessage(websocketpp::connection_hdl hdl,
+                                websocket::Server::message_ptr msg)
+{
+  ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
+  if (it != m_channelFaces.end())
+    {
+      it->second->handleReceive(msg->get_payload());
+    }
+}
+
+void
+WebSocketChannel::handleOpen(websocketpp::connection_hdl hdl)
+{
+  std::string remote;
+  try
+    {
+      remote = "wsclient://" + m_server.get_con_from_hdl(hdl)->get_remote_endpoint();
+    }
+  catch (websocketpp::lib::error_code ec)
+    {
+      NFD_LOG_DEBUG("handleOpen: cannot get remote uri");
+      websocketpp::lib::error_code ecode;
+      m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", ecode);
+    }
+  shared_ptr<WebSocketFace> face = make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
+                                                              hdl, boost::ref(m_server));
+  m_onFaceCreatedCallback(face);
+  m_channelFaces[hdl] = face;
+}
+
+void
+WebSocketChannel::handleClose(websocketpp::connection_hdl hdl)
+{
+  ChannelFaceMap::iterator it = m_channelFaces.find(hdl);
+  if (it != m_channelFaces.end())
+    {
+      NFD_LOG_DEBUG("handleClose: remove client");
+      m_channelFaces.erase(it);
+    }
+}
+
+
+void
+WebSocketChannel::listen(const FaceCreatedCallback& onFaceCreated)
+{
+  if (m_isListening)
+    {
+      throw Error("Listen already called on this channel");
+    }
+  m_isListening = true;
+
+  m_onFaceCreatedCallback = onFaceCreated;
+
+  try
+    {
+      m_server.listen(m_localEndpoint);
+    }
+  catch (websocketpp::lib::error_code ec)
+    {
+      throw Error("Failed to listen on local endpoint");
+    }
+
+  m_server.start_accept();
+}
+
+size_t
+WebSocketChannel::size() const
+{
+  return m_channelFaces.size();
+}
+
+} // namespace nfd
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
new file mode 100644
index 0000000..05d8f99
--- /dev/null
+++ b/daemon/face/websocket-channel.hpp
@@ -0,0 +1,122 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
+#define NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
+
+#include "channel.hpp"
+#include "core/global-io.hpp"
+#include "core/scheduler.hpp"
+#include "websocket-face.hpp"
+
+namespace nfd {
+
+/**
+ * \brief Class implementing WebSocket-based channel to create faces
+ *
+ *
+ */
+class WebSocketChannel : public Channel
+{
+public:
+  /**
+   * \brief Exception of WebSocketChannel
+   */
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : runtime_error(what)
+    {
+    }
+  };
+
+  /**
+   * \brief Create WebSocket channel for the local endpoint
+   *
+   * To enable creation of faces upon incoming connections,
+   * one needs to explicitly call WebSocketChannel::listen method.
+   * The created socket is bound to the localEndpoint.
+   *
+   * \throw WebSocketChannel::Error if bind on the socket fails
+   */
+  explicit
+  WebSocketChannel(const websocket::Endpoint& localEndpoint);
+
+  virtual
+  ~WebSocketChannel();
+
+  /**
+   * \brief Enable listening on the local endpoint, accept connections,
+   *        and create faces when remote host makes a connection
+   * \param onFaceCreated  Callback to notify successful creation of the face
+   *
+   * \throws WebSocketChannel::Error if called multiple times
+   */
+  void
+  listen(const FaceCreatedCallback& onFaceCreated);
+
+  /**
+   * \brief Get number of faces in the channel
+   */
+  size_t
+  size() const;
+
+private:
+  void
+  handleMessage(websocketpp::connection_hdl hdl, websocket::Server::message_ptr msg);
+
+  void
+  handleOpen(websocketpp::connection_hdl hdl);
+
+  void
+  handleClose(websocketpp::connection_hdl hdl);
+
+private:
+  websocket::Endpoint m_localEndpoint;
+
+  websocket::Server m_server;
+
+  /**
+   * Callbacks for face creation.
+   * New communications are detected using async_receive_from.
+   * Its handler has a fixed signature. No space for the face callback
+   */
+  FaceCreatedCallback m_onFaceCreatedCallback;
+
+  typedef std::map< websocketpp::connection_hdl, shared_ptr<WebSocketFace> > ChannelFaceMap;
+  ChannelFaceMap m_channelFaces;
+
+  /**
+   * \brief If true, it means the function listen has already been called
+   */
+  bool m_isListening;
+
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
diff --git a/daemon/face/websocket-face.cpp b/daemon/face/websocket-face.cpp
new file mode 100644
index 0000000..4712cfc
--- /dev/null
+++ b/daemon/face/websocket-face.cpp
@@ -0,0 +1,97 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "websocket-face.hpp"
+
+namespace nfd {
+
+NFD_LOG_INIT("WebSocketFace");
+
+WebSocketFace::WebSocketFace(const FaceUri& remoteUri, const FaceUri& localUri,
+                             websocketpp::connection_hdl hdl,
+                             websocket::Server& server)
+  : Face(remoteUri, localUri)
+  , m_handle(hdl)
+  , m_server(server)
+  , m_closed(false)
+{
+}
+
+
+void
+WebSocketFace::sendInterest(const Interest& interest)
+{
+  this->onSendInterest(interest);
+  const Block& payload = interest.wireEncode();
+  m_server.send(m_handle, payload.wire(), payload.size(), websocketpp::frame::opcode::binary);
+}
+
+void
+WebSocketFace::sendData(const Data& data)
+{
+  this->onSendData(data);
+  const Block& payload = data.wireEncode();
+  m_server.send(m_handle, payload.wire(), payload.size(), websocketpp::frame::opcode::binary);
+}
+
+void
+WebSocketFace::close()
+{
+  if (m_closed == false)
+    {
+      m_closed = true;
+      websocketpp::lib::error_code ecode;
+      m_server.close(m_handle, websocketpp::close::status::normal, "closed by nfd", ecode);
+    }
+}
+
+void
+WebSocketFace::handleReceive(const std::string& msg)
+{
+  // Copy message into Face internal buffer
+  BOOST_ASSERT(msg.size() <= MAX_NDN_PACKET_SIZE);
+
+  // Try to parse message data
+  bool isOk = true;
+  Block element;
+  isOk = Block::fromBuffer(reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size(), element);
+  if (!isOk)
+    {
+      NFD_LOG_TRACE("[id:" << this->getId()
+                    << "] Received invalid NDN packet of length ["
+                    << msg.size() << "]");
+      return;
+    }
+
+  if (!this->decodeAndDispatchInput(element))
+    {
+      NFD_LOG_WARN("[id:" << this->getId()
+                   << "] Received unrecognized block of type ["
+                   << element.type() << "]");
+      // ignore unknown packet and proceed
+    }
+}
+
+} // namespace nfd
diff --git a/daemon/face/websocket-face.hpp b/daemon/face/websocket-face.hpp
new file mode 100644
index 0000000..3f2a932
--- /dev/null
+++ b/daemon/face/websocket-face.hpp
@@ -0,0 +1,77 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
+#define NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
+
+#include "face.hpp"
+#include "core/logger.hpp"
+
+#ifndef HAVE_WEBSOCKET
+#error "Cannot include this file when WebSocket support is not enabled"
+#endif // HAVE_WEBSOCKET
+
+#include "websocketpp.hpp"
+
+namespace nfd {
+
+namespace websocket {
+typedef boost::asio::ip::tcp::endpoint Endpoint;
+typedef websocketpp::server<websocketpp::config::asio> Server;
+} // namespace websocket
+
+
+/**
+ * \brief Implementation of Face abstraction that uses WebSocket
+ *        as underlying transport mechanism
+ */
+class WebSocketFace : public Face
+{
+public:
+  WebSocketFace(const FaceUri& remoteUri, const FaceUri& localUri,
+                websocketpp::connection_hdl hdl, websocket::Server& server);
+
+  // from Face
+  virtual void
+  sendInterest(const Interest& interest);
+
+  virtual void
+  sendData(const Data& data);
+
+  virtual void
+  close();
+
+  void
+  handleReceive(const std::string& msg);
+
+private:
+  websocketpp::connection_hdl m_handle;
+  websocket::Server& m_server;
+  bool m_closed;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
new file mode 100644
index 0000000..224a75b
--- /dev/null
+++ b/daemon/face/websocket-factory.cpp
@@ -0,0 +1,84 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#include "websocket-factory.hpp"
+
+namespace nfd {
+
+using namespace boost::asio;
+
+NFD_LOG_INIT("WebSocketFactory");
+
+WebSocketFactory::WebSocketFactory(const std::string& defaultPort)
+  : m_defaultPort(defaultPort)
+{
+}
+
+shared_ptr<WebSocketChannel>
+WebSocketFactory::createChannel(const websocket::Endpoint& endpoint)
+{
+  shared_ptr<WebSocketChannel> channel = findChannel(endpoint);
+  if (static_cast<bool>(channel))
+    return channel;
+
+  channel = make_shared<WebSocketChannel>(boost::cref(endpoint));
+  m_channels[endpoint] = channel;
+
+  return channel;
+}
+
+shared_ptr<WebSocketChannel>
+WebSocketFactory::createChannel(const std::string& localIPAddress,
+                                uint16_t localPort)
+{
+  boost::system::error_code ec;
+  ip::address address = ip::address::from_string(localIPAddress, ec);
+  if (ec)
+    {
+      throw Error("Invalid address format: " + localIPAddress);
+    }
+  websocket::Endpoint endpoint(address, localPort);
+  return createChannel(endpoint);
+}
+
+shared_ptr<WebSocketChannel>
+WebSocketFactory::findChannel(const websocket::Endpoint& localEndpoint)
+{
+  ChannelMap::iterator i = m_channels.find(localEndpoint);
+  if (i != m_channels.end())
+    return i->second;
+  else
+    return shared_ptr<WebSocketChannel>();
+}
+
+void
+WebSocketFactory::createFace(const FaceUri& uri,
+                             const FaceCreatedCallback& onCreated,
+                             const FaceConnectFailedCallback& onConnectFailed)
+{
+  throw Error("WebSocketFactory does not support 'createFace' operation");
+}
+
+} // namespace nfd
diff --git a/daemon/face/websocket-factory.hpp b/daemon/face/websocket-factory.hpp
new file mode 100644
index 0000000..b241fcc
--- /dev/null
+++ b/daemon/face/websocket-factory.hpp
@@ -0,0 +1,108 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+#ifndef NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
+#define NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
+
+#include "protocol-factory.hpp"
+#include "websocket-channel.hpp"
+
+
+namespace nfd {
+
+class WebSocketFactory : public ProtocolFactory
+{
+public:
+  /**
+   * \brief Exception of WebSocketFactory
+   */
+  class Error : public ProtocolFactory::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : ProtocolFactory::Error(what)
+    {
+    }
+  };
+
+  explicit
+  WebSocketFactory(const std::string& defaultPort);
+
+  /**
+   * \brief Create WebSocket-based channel using websocket::Endpoint
+   *
+   * websocket::Endpoint is really an alias for boost::asio::ip::tcp::endpoint.
+   *
+   * If this method called twice with the same endpoint, only one channel
+   * will be created.  The second call will just retrieve the existing
+   * channel.
+   *
+   * \returns always a valid pointer to a WebSocketChannel object, an exception
+   *          is thrown if it cannot be created.
+   *
+   * \throws WebSocketFactory::Error
+   *
+   */
+  shared_ptr<WebSocketChannel>
+  createChannel(const websocket::Endpoint& localEndpoint);
+
+  /**
+   * \brief Create WebSocket-based channel using specified ip address and port number
+   *
+   * \throws WebSocketFactory::Error
+   */
+  shared_ptr<WebSocketChannel>
+  createChannel(const std::string& localIPAddress,
+                uint16_t localPort);
+
+  // from Factory
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
+
+private:
+
+  /**
+   * \brief Look up WebSocketChannel using specified local endpoint
+   *
+   * \returns shared pointer to the existing WebSocketChannel object
+   *          or empty shared pointer when such channel does not exist
+   *
+   * \throws never
+   */
+  shared_ptr<WebSocketChannel>
+  findChannel(const websocket::Endpoint& localEndpoint);
+
+  typedef std::map< websocket::Endpoint, shared_ptr<WebSocketChannel> > ChannelMap;
+  ChannelMap m_channels;
+
+  std::string m_defaultPort;
+};
+
+} // namespace nfd
+
+#endif // NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
diff --git a/daemon/face/websocketpp.hpp b/daemon/face/websocketpp.hpp
new file mode 100644
index 0000000..1e934b6
--- /dev/null
+++ b/daemon/face/websocketpp.hpp
@@ -0,0 +1,36 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/**
+ * Copyright (c) 2014  Regents of the University of California,
+ *                     Arizona Board of Regents,
+ *                     Colorado State University,
+ *                     University Pierre & Marie Curie, Sorbonne University,
+ *                     Washington University in St. Louis,
+ *                     Beijing Institute of Technology,
+ *                     The University of Memphis
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_DAEMON_FACE_WEBSOCKETPP_HPP
+#define NFD_DAEMON_FACE_WEBSOCKETPP_HPP
+
+// suppress websocketpp warnings
+#pragma GCC system_header
+#pragma clang system_header
+
+#include "websocketpp/config/asio_no_tls.hpp"
+#include "websocketpp/server.hpp"
+
+#endif // NFD_DAEMON_FACE_WEBSOCKETPP_HPP
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index c514637..e2c2848 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -41,6 +41,10 @@
 #include "face/ethernet-factory.hpp"
 #endif // HAVE_LIBPCAP
 
+#ifdef HAVE_WEBSOCKET
+#include "face/websocket-factory.hpp"
+#endif // HAVE_WEBSOCKET
+
 #include <ndn-cxx/management/nfd-face-event-notification.hpp>
 
 namespace nfd {
@@ -142,6 +146,7 @@
   bool hasSeenTcp = false;
   bool hasSeenUdp = false;
   bool hasSeenEther = false;
+  bool hasSeenWebSocket = false;
 
   const std::list<shared_ptr<NetworkInterfaceInfo> > nicList(listNetworkInterfaces());
 
@@ -181,6 +186,14 @@
 
           processSectionEther(item->second, isDryRun, nicList);
         }
+      else if (item->first == "websocket")
+        {
+          if (hasSeenWebSocket)
+            throw Error("Duplicate \"websocket\" section");
+          hasSeenWebSocket = true;
+
+          processSectionWebSocket(item->second, isDryRun);
+        }
       else
         {
           throw Error("Unrecognized option \"" + item->first + "\"");
@@ -621,6 +634,107 @@
 #endif // HAVE_LIBPCAP
 }
 
+void
+FaceManager::processSectionWebSocket(const ConfigSection& configSection, bool isDryRun)
+{
+  // ; the websocket section contains settings of WebSocket faces and channels
+  // websocket
+  // {
+  //   listen yes ; set to 'no' to disable WebSocket listener, default 'yes'
+  //   port 9696 ; WebSocket listener port number
+  //   enable_v4 yes ; set to 'no' to disable listening on IPv4 socket, default 'yes'
+  //   enable_v6 yes ; set to 'no' to disable listening on IPv6 socket, default 'yes'
+  // }
+
+#if defined(HAVE_WEBSOCKET)
+
+  std::string port = "9696";
+  bool needToListen = true;
+  bool enableV4 = true;
+  bool enableV6 = true;
+
+  for (ConfigSection::const_iterator i = configSection.begin();
+       i != configSection.end();
+       ++i)
+    {
+      if (i->first == "port")
+        {
+          port = i->second.get_value<std::string>();
+          try
+            {
+              uint16_t portNo = boost::lexical_cast<uint16_t>(port);
+              NFD_LOG_TRACE("WebSocket port set to " << portNo);
+            }
+          catch (const std::bad_cast& error)
+            {
+              throw ConfigFile::Error("Invalid value for option " +
+                                      i->first + "\" in \"websocket\" section");
+            }
+        }
+      else if (i->first == "listen")
+        {
+          needToListen = parseYesNo(i, i->first, "websocket");
+        }
+      else if (i->first == "enable_v4")
+        {
+          enableV4 = parseYesNo(i, i->first, "websocket");
+        }
+      else if (i->first == "enable_v6")
+        {
+          enableV6 = parseYesNo(i, i->first, "websocket");
+        }
+      else
+        {
+          throw ConfigFile::Error("Unrecognized option \"" +
+                                  i->first + "\" in \"websocket\" section");
+        }
+    }
+
+  if (!enableV4 && !enableV6)
+    {
+      throw ConfigFile::Error("IPv4 and IPv6 channels have been disabled."
+                              " Remove \"websocket\" section to disable WebSocket channels or"
+                              " re-enable at least one channel type.");
+    }
+
+  if (!enableV4 && enableV6)
+    {
+      throw ConfigFile::Error("NFD does not allow pure IPv6 WebSocket channel.");
+    }
+
+  if (!isDryRun)
+    {
+      shared_ptr<WebSocketFactory> factory = make_shared<WebSocketFactory>(boost::cref(port));
+      m_factories.insert(std::make_pair("websocket", factory));
+      uint16_t portNo = boost::lexical_cast<uint16_t>(port);
+
+      if (enableV6 && enableV4)
+        {
+          shared_ptr<WebSocketChannel> ip46Channel = factory->createChannel("::", portNo);
+          if (needToListen)
+            {
+              ip46Channel->listen(bind(&FaceTable::add, &m_faceTable, _1));
+            }
+
+          m_factories.insert(std::make_pair("websocket46", factory));
+        }
+      else if (enableV4)
+        {
+          shared_ptr<WebSocketChannel> ipv4Channel = factory->createChannel("0.0.0.0", portNo);
+          if (needToListen)
+            {
+              ipv4Channel->listen(bind(&FaceTable::add, &m_faceTable, _1));
+            }
+
+          m_factories.insert(std::make_pair("websocket4", factory));
+        }
+    }
+#else
+  throw ConfigFile::Error("NFD was compiled without WebSocket, "
+                          "cannot process \"websocket\" section");
+#endif // HAVE_WEBSOCKET
+}
+
 
 void
 FaceManager::onFaceRequest(const Interest& request)
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index b5a7890..649ed4c 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -144,6 +144,9 @@
                       bool isDryRun,
                       const std::list<shared_ptr<NetworkInterfaceInfo> >& nicList);
 
+  void
+  processSectionWebSocket(const ConfigSection& configSection, bool isDryRun);
+
   /** \brief parse a config option that can be either "yes" or "no"
    *  \throw ConfigFile::Error value is neither "yes" nor "no"
    *  \return true if "yes", false if "no"
diff --git a/nfd.conf.sample.in b/nfd.conf.sample.in
index 9a081e4..960c59c 100644
--- a/nfd.conf.sample.in
+++ b/nfd.conf.sample.in
@@ -115,6 +115,16 @@
   @IF_HAVE_LIBPCAP@  mcast yes ; set to 'no' to disable Ethernet multicast, default 'yes'
   @IF_HAVE_LIBPCAP@  mcast_group 01:00:5E:00:17:AA ; Ethernet multicast group
   @IF_HAVE_LIBPCAP@}
+
+  ; The websocket section contains settings of WebSocket faces and channels.
+
+  @IF_HAVE_WEBSOCKET@websocket
+  @IF_HAVE_WEBSOCKET@{
+  @IF_HAVE_WEBSOCKET@  listen yes ; set to 'no' to disable WebSocket listener, default 'yes'
+  @IF_HAVE_WEBSOCKET@  port 9696 ; WebSocket listener port number
+  @IF_HAVE_WEBSOCKET@  enable_v4 yes ; set to 'no' to disable listening on IPv4 socket, default 'yes'
+  @IF_HAVE_WEBSOCKET@  enable_v6 yes ; set to 'no' to disable listening on IPv6 socket, default 'yes'
+  @IF_HAVE_WEBSOCKET@}
 }
 
 ; The authorizations section grants privileges to authorized keys.
diff --git a/tests/wscript b/tests/wscript
index 8b9c6fc..be93c0a 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -52,7 +52,8 @@
             features='cxx cxxprogram',
             source=bld.path.ant_glob(['daemon/**/*.cpp'],
                                      excl=['daemon/face/ethernet.cpp',
-                                           'daemon/face/unix-*.cpp']),
+                                           'daemon/face/unix-*.cpp',
+                                           'daemon/face/websocket-*.cpp']),
             use='daemon-objects unit-tests-main',
             includes='.',
             install_path=None,
@@ -64,6 +65,9 @@
         if bld.env['HAVE_UNIX_SOCKETS']:
             unit_tests_nfd.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
 
+        if bld.env['HAVE_WEBSOCKET']:
+            unit_tests_nfd.source += bld.path.ant_glob('daemon/face/websocket-*.cpp')
+
         unit_tests_rib = bld.program(
             target='../unit-tests-rib',
             features='cxx cxxprogram',
diff --git a/websocketpp b/websocketpp
new file mode 160000
index 0000000..e7ce038
--- /dev/null
+++ b/websocketpp
@@ -0,0 +1 @@
+Subproject commit e7ce038207e2c1727a490421afbbe8e41b242318
diff --git a/wscript b/wscript
index 4e8622b..b3f1480 100644
--- a/wscript
+++ b/wscript
@@ -32,13 +32,14 @@
 
 def options(opt):
     opt.load(['compiler_cxx', 'gnu_dirs'])
-    opt.load(['boost', 'unix-socket', 'dependency-checker',
+    opt.load(['boost', 'unix-socket', 'dependency-checker', 'websocket',
               'default-compiler-flags', 'coverage',
               'doxygen', 'sphinx_build'],
              tooldir=['.waf-tools'])
 
     nfdopt = opt.add_option_group('NFD Options')
     opt.addUnixOptions(nfdopt)
+    opt.addWebsocketOptions(nfdopt)
     opt.addDependencyOptions(nfdopt, 'libpcap')
     nfdopt.add_option('--without-libpcap', action='store_true', default=False,
                       dest='without_libpcap',
@@ -55,7 +56,7 @@
 def configure(conf):
     conf.load(['compiler_cxx', 'gnu_dirs',
                'default-compiler-flags',
-               'boost', 'dependency-checker',
+               'boost', 'dependency-checker', 'websocket',
                'doxygen', 'sphinx_build'])
 
     conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
@@ -79,6 +80,7 @@
         return
 
     conf.load('unix-socket')
+    conf.checkWebsocket(mandatory=True)
 
     conf.checkDependency(name='librt', lib='rt', mandatory=False)
     conf.checkDependency(name='libresolv', lib='resolv', mandatory=False)
@@ -130,9 +132,10 @@
         source=bld.path.ant_glob(['daemon/**/*.cpp'],
                                  excl=['daemon/face/ethernet-*.cpp',
                                        'daemon/face/unix-*.cpp',
+                                       'daemon/face/websocket-*.cpp',
                                        'daemon/main.cpp']),
         use='core-objects',
-        includes='daemon',
+        includes='daemon websocketpp',
         export_includes='daemon',
         )
 
@@ -143,6 +146,9 @@
     if bld.env['HAVE_UNIX_SOCKETS']:
         nfd_objects.source += bld.path.ant_glob('daemon/face/unix-*.cpp')
 
+    if bld.env['HAVE_WEBSOCKET']:
+        nfd_objects.source += bld.path.ant_glob('daemon/face/websocket-*.cpp')
+
     bld(target='bin/nfd',
         features='cxx cxxprogram',
         source='daemon/main.cpp',
@@ -177,7 +183,8 @@
         source='nfd.conf.sample.in',
         target='nfd.conf.sample',
         install_path="${SYSCONFDIR}/ndn",
-        IF_HAVE_LIBPCAP="" if bld.env['HAVE_LIBPCAP'] else "; ")
+        IF_HAVE_LIBPCAP="" if bld.env['HAVE_LIBPCAP'] else "; ",
+        IF_HAVE_WEBSOCKET="" if bld.env['HAVE_WEBSOCKET'] else "; ")
 
     bld(features='subst',
         source='tools/nfd-status-http-server.py',
