diff --git a/.gitignore b/.gitignore
index b21dfe48df3b113fb841bbfc8809ca2206ff745d..59de5074f9f8f58de6f1b950e70b070bb21bb003 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-obfsproxy/obfsproxy
-obfsclient/obfsclient
+client/client
+server/server
+obfsvpn-client
 *.swp
 *.swo
diff --git a/client/main.go b/client/main.go
index daf6ce4b9f03a621e7bc0c7acbedcf709e8b7776..80ebb35221ce720249bad1f7840a3e2ab38c0f7c 100644
--- a/client/main.go
+++ b/client/main.go
@@ -51,6 +51,8 @@ func main() {
 		logger.Fatalf("cannot get dialer: %v", err)
 	}
 
+	// TODO make this configurable via a Config struct
+	// TODO make sure we're disabling the crypto options for KCP
 	if os.Getenv("KCP") == "1" {
 		dialer.DialFunc = func(network, address string) (net.Conn, error) {
 			return kcp.Dial(address)
diff --git a/dialer.go b/dialer.go
index a269c4ff2ce29ad094930471c0c375429d3060bc..db4c6babb7956385013962655d75c3952361a1ac 100644
--- a/dialer.go
+++ b/dialer.go
@@ -158,7 +158,6 @@ func (d *Dialer) dial(ctx context.Context, network, address string, f func(netwo
 		log.Println("REPLACING DIALFUNC")
 		f = d.DialFunc
 	}
-	log.Printf(">>> client factory dial. f=%v", f)
 
 	return d.clientFactory.Dial(network, address, f, args)
 }
diff --git a/listener.go b/listener.go
index 30ad401575972f1c110c9309368a6e27c93ddf85..70b45035177a90396b9d4137df2625c42c14e534 100644
--- a/listener.go
+++ b/listener.go
@@ -10,11 +10,16 @@ import (
 	"net"
 
 	pt "git.torproject.org/pluggable-transports/goptlib.git"
+	"github.com/xtaci/kcp-go"
 	"gitlab.com/yawning/obfs4.git/common/ntor"
 	"gitlab.com/yawning/obfs4.git/transports/base"
 	"gitlab.com/yawning/obfs4.git/transports/obfs4"
 )
 
+const (
+	netKCP = "kcp"
+)
+
 // ListenConfig contains options for listening to an address.
 // If Seed is not set it defaults to a randomized value.
 // If StateDir is not set the current working directory is used.
@@ -79,7 +84,7 @@ func NewListenConfigCert(cert string) (*ListenConfig, error) {
 }
 
 // Wrap takes an existing net.Listener and wraps it in a listener that is
-// configured to perform the ntor handshake.
+// configured to perform the ntor handshake and copy data through the obfuscated conn.
 // Values from the inner net.ListenConfig are ignored.
 func (lc *ListenConfig) Wrap(ctx context.Context, ln net.Listener) (*Listener, error) {
 	args := make(pt.Args)
@@ -105,13 +110,22 @@ func (lc *ListenConfig) Wrap(ctx context.Context, ln net.Listener) (*Listener, e
 	return &Listener{sf: sf, ln: ln}, nil
 }
 
-// Listen announces on the local network address.
-//
+// Listen listens on the local network address.
 // See func net.Dial for a description of the network and address parameters.
 func (lc *ListenConfig) Listen(ctx context.Context, network, address string) (*Listener, error) {
-	ln, err := lc.ListenConfig.Listen(ctx, network, address)
-	if err != nil {
-		return nil, err
+	var ln net.Listener
+	var err error
+	switch network {
+	case netKCP:
+		ln, err = kcp.Listen(address)
+		if err != nil {
+			return nil, err
+		}
+	default:
+		ln, err = lc.ListenConfig.Listen(ctx, network, address)
+		if err != nil {
+			return nil, err
+		}
 	}
 	return lc.Wrap(ctx, ln)
 }
diff --git a/server/main.go b/server/main.go
index 1b9f3996ba423c14f54507b1411aaa6b64526f7f..3ade4dc7913c56b3e83d2f8ac743d03d058ab4a4 100644
--- a/server/main.go
+++ b/server/main.go
@@ -85,17 +85,21 @@ func main() {
 	// Setup graceful shutdown.
 	ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
 
+	// TODO pass a "mode" ? (kcp)
 	listenConfig, err := obfsvpn.NewListenConfig(
 		cfg.NodeID, cfg.PrivateKey, cfg.PublicKey,
 		cfg.DRBGSeed,
-		stateDir)
+		stateDir,
+	)
 	if err != nil {
 		logger.Fatalf("Error creating listener from config: %v", err)
 	}
 
 	logger.Printf("DEBUG: %v", listenConfig)
 
+	// TODO: pass kcp mode
 	ln, err := listenConfig.Listen(ctx, "tcp", addr)
+
 	if err != nil {
 		logger.Fatalf("error binding to %s: %v", addr, err)
 	}