diff --git a/.gitignore b/.gitignore
index 198a7f66..79a9e247 100755
--- a/.gitignore
+++ b/.gitignore
@@ -136,4 +136,5 @@ zeroidc/target/
__pycache__
*.pyc
*_source.tar.bz2
-snap/.snapcraft
\ No newline at end of file
+snap/.snapcraft
+tcp-proxy/tcp-proxy
diff --git a/tcp-proxy/Makefile b/tcp-proxy/Makefile
new file mode 100644
index 00000000..af4e71e3
--- /dev/null
+++ b/tcp-proxy/Makefile
@@ -0,0 +1,7 @@
+CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)
+
+all:
+ $(CXX) -O3 -fno-rtti -o tcp-proxy tcp-proxy.cpp
+
+clean:
+ rm -f *.o tcp-proxy *.dSYM
diff --git a/tcp-proxy/README.md b/tcp-proxy/README.md
new file mode 100644
index 00000000..5af078a2
--- /dev/null
+++ b/tcp-proxy/README.md
@@ -0,0 +1,4 @@
+TCP Proxy Server
+======
+
+This is the TCP proxy server we run for TCP tunneling from peers behind difficult NATs. Regular users won't have much use for this.
diff --git a/tcp-proxy/tcp-proxy.cpp b/tcp-proxy/tcp-proxy.cpp
new file mode 100644
index 00000000..d5735198
--- /dev/null
+++ b/tcp-proxy/tcp-proxy.cpp
@@ -0,0 +1,317 @@
+/*
+ * ZeroTier One - Network Virtualization Everywhere
+ * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
+ *
+ * This program 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.
+ *
+ * This program 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 this program. If not, see .
+ */
+
+// HACK! Will eventually use epoll() or something in Phy<> instead of select().
+// Also be sure to change ulimit -n and fs.file-max in /etc/sysctl.conf on relays.
+#if defined(__linux__) || defined(__LINUX__) || defined(__LINUX) || defined(LINUX)
+#include
+#include
+#undef __FD_SETSIZE
+#define __FD_SETSIZE 1048576
+#undef FD_SETSIZE
+#define FD_SETSIZE 1048576
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include