Skip to content

Instantly share code, notes, and snippets.

@c2h2
Created January 3, 2019 09:02
Show Gist options
  • Save c2h2/fd4729b7d33972bad24949d2bf741265 to your computer and use it in GitHub Desktop.
Save c2h2/fd4729b7d33972bad24949d2bf741265 to your computer and use it in GitHub Desktop.
kcptun template
HOST=yourhost.com:38989
LISTEN=12345 #example port
KEY=your_very_secure_long_long_key
echo $HOST $LISTEN $KEY
#kill first
kill $(ps aux | grep ${LISTEN} | awk '{print $2}');
#main proc
while true; do ./client_linux_amd64 -r "${HOST}" -l ":${LISTEN}" --crypt aes --key ${KEY} --mtu 1350 --sndwnd 128 --rcvwnd 1024 --mode fast2 --quiet; sleep 2; done &
#watchdog
while true; do sleep 3600; kill $(ps aux | grep ${LISTEN} | awk '{print $2}'); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment