From bfe7b7cf13cfe827e40c91f02c97d806d023506e Mon Sep 17 00:00:00 2001 From: fibonacci1729 Date: Thu, 26 Apr 2018 14:48:07 -0600 Subject: [PATCH] docs for draft connect detach mode --- docs/reference/dep-007.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/reference/dep-007.md b/docs/reference/dep-007.md index 0071e2f..257d743 100644 --- a/docs/reference/dep-007.md +++ b/docs/reference/dep-007.md @@ -158,3 +158,27 @@ Connect to multi-port:80 on localhost:9090 Connect to multi-port:81 on localhost:9191 ``` + +# Detaching from connect + +Using the `--detach` flag in `draft connect` will spawn a new Draft process that exports +the tunnel connection environment to standard out. All flags, excluding `--detach` will be +propagated to the detached Draft process. A hidden `--export` flag is appended to this set +of flags which instructs Draft to export the connection environment. As a result, container +logs are lost if Draft is connected in detach mode. + +Continuing with the examples above: +``` +$ eval $(draft connect -p 8081:8080 -c go --detach) +$ curl localhost:8081 +Hello World, I'm Golang! +``` + +> Note that re-executing `draft connect --detach` will establish a new tunnel. In addition, Draft +> does not track the state of detached Draft tunnel connections and it is the responsibility of +> the user to terminate detached Draft processes. + +To illustate terminating a detached draft connection: +``` +$ kill $(ps -a | grep -m1 draft | awk '{print $1}') +``` \ No newline at end of file