# HG changeset patch # User Henry Precheur # Date 1498173950 25200 # Thu Jun 22 16:25:50 2017 -0700 # Node ID f7567d5fafc073a56c55b94c444ed8f9a931355e # Parent a43eef7df3c5945a314c254f3a450f2ba213c89a use sauceproxy_ctl separatly diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ Dependencies ============ +go build github.com/saucelabs/sauceproxy-rest/cmd/sauceproxy_ctl +go build github.com/elazarl/goproxy/examples/goproxy-basic +go build bitbucket.org/henry/kgp/cmd/kgpdemux + - stunnel - HTTP forwarding proxy diff --git a/generate_config.sh b/generate_config.sh new file mode 100644 --- /dev/null +++ b/generate_config.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# +# assumes sauceproxy_ctl is installed +# +# go get github.com/saucelabs/sauceproxy-rest +# go build github.com/saucelabs/sauceproxy-rest/cmd/sauceproxy_ctl +# + +SSLSOCK='localhost:4443' + +tunnelid="$@" + +# Get the tunnel's address +kgp_host=$(./sauceproxy_ctl kgp_host $tunnelid) +printf 'Tunnel Address: %s\n' "$kgp_host" + +# Create metadata file for kgpdemux +cat > ./meta.json < ./stunnel.conf < < ./meta.json\n' "$SSLSOCK" diff --git a/scfs.sh b/scfs.sh deleted file mode 100644 --- a/scfs.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# -# assumes sauceproxy_ctl is installed -# -# go get github.com/saucelabs/sauceproxy-rest -# go build github.com/saucelabs/sauceproxy-rest/cmd/sauceproxy_ctl -# - -readonly ctl='./sauceproxy_ctl -v' -readonly sslsock=/tmp/scfs_stunnel.sock - -echo 'Creating tunnel' -readonly tunnelid=$($ctl create) -trap "$ctl shutdown $tunnelid" INT -readonly kgp_host=$($ctl kgp_host $tunnelid) -printf 'Tunnel ID: %s, Tunnel Address: %s\n' "$tunnelid" "$kgp_host" - -cat > ./meta.json < ./stunnel.conf < < ./meta.json\n' "$sslsock" -# Ping the tunnel in the background -while true -do - $ctl ping -c $tunnelid || { echo "keepalive error"; break; } - sleep 240 -done