diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index c8dbcf9..78adf6f 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -15,8 +15,8 @@
 NFD_LOG_INIT("EthernetFactory")
 
 shared_ptr<EthernetFace>
-EthernetFactory::createMulticast(const ethernet::Endpoint& interface,
-                                 const ethernet::Address& address)
+EthernetFactory::createMulticastFace(const ethernet::Endpoint& interface,
+                                     const ethernet::Address& address)
 {
   std::vector<ethernet::Endpoint> ifs = findAllInterfaces();
   if (std::find(ifs.begin(), ifs.end(), interface) == ifs.end())
@@ -25,7 +25,7 @@
   if (!address.isMulticast())
     throw Error(address.toString() + " is not a multicast address");
 
-  shared_ptr<EthernetFace> face = findMulticast(interface, address);
+  shared_ptr<EthernetFace> face = findMulticastFace(interface, address);
   if (face)
     return face;
 
@@ -92,8 +92,8 @@
 }
 
 shared_ptr<EthernetFace>
-EthernetFactory::findMulticast(const ethernet::Endpoint& interface,
-                               const ethernet::Address& address) const
+EthernetFactory::findMulticastFace(const ethernet::Endpoint& interface,
+                                   const ethernet::Address& address) const
 {
   MulticastFacesMap::const_iterator i = m_multicastFaces.find(std::make_pair(interface, address));
   if (i != m_multicastFaces.end())
@@ -102,4 +102,12 @@
     return shared_ptr<EthernetFace>();
 }
 
+void
+EthernetFactory::createFace(const FaceUri& uri,
+                            const FaceCreatedCallback& onCreated,
+                            const FaceConnectFailedCallback& onConnectFailed)
+{
+  throw Error("EthernetFactory does not support 'createFace' operation");
+}
+
 } // namespace nfd
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
index d676f47..2eeca7b 100644
--- a/daemon/face/ethernet-factory.hpp
+++ b/daemon/face/ethernet-factory.hpp
@@ -39,8 +39,8 @@
    * \throws EthernetFactory::Error or EthernetFace::Error
    */
   shared_ptr<EthernetFace>
-  createMulticast(const ethernet::Endpoint& interface,
-                  const ethernet::Address& address);
+  createMulticastFace(const ethernet::Endpoint& interface,
+                      const ethernet::Address& address);
 
   /**
    * \brief Get a list of devices that can be opened for a live capture
@@ -50,6 +50,13 @@
   static std::vector<ethernet::Endpoint>
   findAllInterfaces();
 
+  // from Factory
+
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
+
 private:
   void
   afterFaceFailed(const ethernet::Endpoint& endpoint,
@@ -64,8 +71,8 @@
    * \throws never
    */
   shared_ptr<EthernetFace>
-  findMulticast(const ethernet::Endpoint& interface,
-                const ethernet::Address& address) const;
+  findMulticastFace(const ethernet::Endpoint& interface,
+                    const ethernet::Address& address) const;
 
 private:
   typedef std::map< std::pair<ethernet::Endpoint, ethernet::Address>,
diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
index f02941e..8a00bde 100644
--- a/daemon/face/protocol-factory.hpp
+++ b/daemon/face/protocol-factory.hpp
@@ -8,9 +8,26 @@
 #define NFD_FACE_PROTOCOL_FACTORY_HPP
 
 #include "common.hpp"
+#include "core/face-uri.hpp"
 
 namespace nfd {
 
+class Face;
+
+/**
+ * \brief Prototype for the callback called when face is created
+ *        (as a response to incoming connection or after connection
+ *        is established)
+ */
+typedef function<void(const shared_ptr<Face>& newFace)> FaceCreatedCallback;
+
+/**
+ * \brief Prototype for the callback that is called when face is failed to
+ *        get created
+ */
+typedef function<void(const std::string& reason)> FaceConnectFailedCallback;
+
+
 class ProtocolFactory
 {
 public:
@@ -21,6 +38,18 @@
   {
     Error(const std::string& what) : std::runtime_error(what) {}
   };
+
+  /** \brief Try to create Face using the supplied Face URI
+   *
+   * This method should automatically choose channel, based on supplied Face URI
+   * and create face.
+   *
+   * \throws Factory::Error if Factory does not support connect operation
+   */
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed) = 0;
 };
 
 } // namespace nfd
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 072ce2e..45b1a48 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -6,13 +6,19 @@
 
 #include "tcp-factory.hpp"
 #include "core/global-io.hpp"
+#include "core/resolver.hpp"
 
 namespace nfd {
 
-shared_ptr<TcpChannel>
-TcpFactory::create(const tcp::Endpoint& endpoint)
+TcpFactory::TcpFactory(const std::string& defaultPort/* = "6363"*/)
+  : m_defaultPort(defaultPort)
 {
-  shared_ptr<TcpChannel> channel = find(endpoint);
+}
+
+shared_ptr<TcpChannel>
+TcpFactory::createChannel(const tcp::Endpoint& endpoint)
+{
+  shared_ptr<TcpChannel> channel = findChannel(endpoint);
   if(static_cast<bool>(channel))
     return channel;
 
@@ -22,7 +28,7 @@
 }
 
 shared_ptr<TcpChannel>
-TcpFactory::create(const std::string& localHost, const std::string& localPort)
+TcpFactory::createChannel(const std::string& localHost, const std::string& localPort)
 {
   using boost::asio::ip::tcp;
 
@@ -34,11 +40,11 @@
   if (i == end)
     return shared_ptr<TcpChannel>();
 
-  return create(*i);
+  return createChannel(*i);
 }
 
 shared_ptr<TcpChannel>
-TcpFactory::find(const tcp::Endpoint& localEndpoint)
+TcpFactory::findChannel(const tcp::Endpoint& localEndpoint)
 {
   ChannelMap::iterator i = m_channels.find(localEndpoint);
   if (i != m_channels.end())
@@ -47,4 +53,47 @@
     return shared_ptr<TcpChannel>();
 }
 
+void
+TcpFactory::createFace(const FaceUri& uri,
+                       const FaceCreatedCallback& onCreated,
+                       const FaceConnectFailedCallback& onConnectFailed)
+{
+  resolver::AddressSelector addressSelector = resolver::AnyAddress();
+  if (uri.getScheme() == "tcp4")
+    addressSelector = resolver::Ipv4Address();
+  else if (uri.getScheme() == "tcp6")
+    addressSelector = resolver::Ipv6Address();
+
+  using boost::asio::ip::tcp;
+  Resolver<tcp>::asyncResolve(uri.getDomain(),
+                              uri.getPort().empty() ? m_defaultPort : uri.getPort(),
+                              bind(&TcpFactory::continueCreateFaceAfterResolve, this, _1,
+                                   onCreated, onConnectFailed),
+                              onConnectFailed,
+                              addressSelector);
+}
+
+void
+TcpFactory::continueCreateFaceAfterResolve(const tcp::Endpoint& endpoint,
+                                           const FaceCreatedCallback& onCreated,
+                                           const FaceConnectFailedCallback& onConnectFailed)
+{
+  // very simple logic for now
+
+  for (ChannelMap::iterator channel = m_channels.begin();
+       channel != m_channels.end();
+       ++channel)
+    {
+      if ((channel->first.address().is_v4() && endpoint.address().is_v4()) ||
+          (channel->first.address().is_v6() && endpoint.address().is_v6()))
+        {
+          channel->second->connect(endpoint, onCreated, onConnectFailed);
+          return;
+        }
+    }
+  onConnectFailed("No channels available to connect to "
+                  + boost::lexical_cast<std::string>(endpoint));
+}
+
+
 } // namespace nfd
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index fbda795..1886f24 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -23,6 +23,9 @@
     Error(const std::string& what) : ProtocolFactory::Error(what) {}
   };
 
+  explicit
+  TcpFactory(const std::string& defaultPort = "6363");
+
   /**
    * \brief Create TCP-based channel using tcp::Endpoint
    *
@@ -41,7 +44,7 @@
    *      for details on ways to create tcp::Endpoint
    */
   shared_ptr<TcpChannel>
-  create(const tcp::Endpoint& localEndpoint);
+  createChannel(const tcp::Endpoint& localEndpoint);
 
   /**
    * \brief Create TCP-based channel using specified host and port number
@@ -54,7 +57,14 @@
    * \throws TcpFactory::Error
    */
   shared_ptr<TcpChannel>
-  create(const std::string& localHost, const std::string& localPort);
+  createChannel(const std::string& localHost, const std::string& localPort);
+
+  // from Factory
+
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
 
 private:
   /**
@@ -66,11 +76,18 @@
    * \throws never
    */
   shared_ptr<TcpChannel>
-  find(const tcp::Endpoint& localEndpoint);
+  findChannel(const tcp::Endpoint& localEndpoint);
+
+  void
+  continueCreateFaceAfterResolve(const tcp::Endpoint& endpoint,
+                                 const FaceCreatedCallback& onCreated,
+                                 const FaceConnectFailedCallback& onConnectFailed);
 
 private:
   typedef std::map< tcp::Endpoint, shared_ptr<TcpChannel> > ChannelMap;
   ChannelMap m_channels;
+
+  std::string m_defaultPort;
 };
 
 } // namespace nfd
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index 070d8c1..20c01d9 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.cpp
@@ -12,13 +12,13 @@
 namespace nfd {
 
 shared_ptr<UnixStreamChannel>
-UnixStreamFactory::create(const std::string& unixSocketPath)
+UnixStreamFactory::createChannel(const std::string& unixSocketPath)
 {
   boost::filesystem::path p(unixSocketPath);
   p = boost::filesystem::canonical(p.parent_path()) / p.filename();
   unix_stream::Endpoint endpoint(p.string());
 
-  shared_ptr<UnixStreamChannel> channel = find(endpoint);
+  shared_ptr<UnixStreamChannel> channel = findChannel(endpoint);
   if (channel)
     return channel;
 
@@ -29,7 +29,7 @@
 }
 
 shared_ptr<UnixStreamChannel>
-UnixStreamFactory::find(const unix_stream::Endpoint& endpoint)
+UnixStreamFactory::findChannel(const unix_stream::Endpoint& endpoint)
 {
   ChannelMap::iterator i = m_channels.find(endpoint);
   if (i != m_channels.end())
@@ -38,4 +38,12 @@
     return shared_ptr<UnixStreamChannel>();
 }
 
+void
+UnixStreamFactory::createFace(const FaceUri& uri,
+                              const FaceCreatedCallback& onCreated,
+                              const FaceConnectFailedCallback& onConnectFailed)
+{
+  throw Error("UnixStreamFactory does not support 'createFace' operation");
+}
+
 } // namespace nfd
diff --git a/daemon/face/unix-stream-factory.hpp b/daemon/face/unix-stream-factory.hpp
index 4b26a3f..ef857d8 100644
--- a/daemon/face/unix-stream-factory.hpp
+++ b/daemon/face/unix-stream-factory.hpp
@@ -36,7 +36,14 @@
    * \throws UnixStreamFactory::Error
    */
   shared_ptr<UnixStreamChannel>
-  create(const std::string& unixSocketPath);
+  createChannel(const std::string& unixSocketPath);
+
+  // from Factory
+
+  virtual void
+  createFace(const FaceUri& uri,
+             const FaceCreatedCallback& onCreated,
+             const FaceConnectFailedCallback& onConnectFailed);
 
 private:
   /**
@@ -48,7 +55,7 @@
    * \throws never
    */
   shared_ptr<UnixStreamChannel>
-  find(const unix_stream::Endpoint& endpoint);
+  findChannel(const unix_stream::Endpoint& endpoint);
 
 private:
   typedef std::map< unix_stream::Endpoint, shared_ptr<UnixStreamChannel> > ChannelMap;
diff --git a/daemon/main.cpp b/daemon/main.cpp
index e971a35..bd511bb 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -172,8 +172,8 @@
 initializeTcp()
 {
   g_tcpFactory = new TcpFactory();
-  g_tcpChannel = g_tcpFactory->create(g_options.m_tcpListen.first,
-                                      g_options.m_tcpListen.second);
+  g_tcpChannel = g_tcpFactory->createChannel(g_options.m_tcpListen.first,
+                                             g_options.m_tcpListen.second);
   g_tcpChannel->listen(
     bind(&onFaceEstablish, _1, static_cast<std::vector<Name>*>(0)),
     &onFaceError);
@@ -191,7 +191,7 @@
 initializeUnix()
 {
   g_unixFactory = new UnixStreamFactory();
-  g_unixChannel = g_unixFactory->create(g_options.m_unixListen);
+  g_unixChannel = g_unixFactory->createChannel(g_options.m_unixListen);
 
   g_unixChannel->listen(
     bind(&onFaceEstablish, _1, static_cast<std::vector<Name>*>(0)),
