From d20336c37384987d71e2326c414cdef6f79e7f4a Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 10 Aug 2016 15:25:53 +0800 Subject: [PATCH] add kcptun --- README.md | 1 + kcptun/Dockerfile | 18 +++++++++++++ kcptun/README.md | 53 +++++++++++++++++++++++++++++++++++++++ kcptun/docker-compose.yml | 22 ++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 kcptun/Dockerfile create mode 100644 kcptun/README.md create mode 100644 kcptun/docker-compose.yml diff --git a/README.md b/README.md index f54ab45..b6e47a8 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ A collection of delicious docker recipes. - [x] fteproxy :+1: - [x] fteproxy-arm :+1: - [x] haproxy-arm +- [x] kcptun :cn: - [x] mysql-proxy - [x] ngrok :+1: - [x] obfsproxy diff --git a/kcptun/Dockerfile b/kcptun/Dockerfile new file mode 100644 index 0000000..3f395ef --- /dev/null +++ b/kcptun/Dockerfile @@ -0,0 +1,18 @@ +# +# Dockerfile for kcptun +# + +FROM alpine +MAINTAINER kev + +ENV KCPTUN_VERSION 20160808 +ENV KCPTUN_FILE kcptun-linux-amd64-${KCPTUN_VERSION}.tar.gz +ENV KCPTUN_URL https://github.com/xtaci/kcptun/releases/download/v${KCPTUN_VERSION}/${KCPTUN_FILE} + +RUN set -xe \ + && apk add --no-cache curl \ + && curl -sSL ${KCPTUN_URL} | tar xz -C /usr/local/bin \ + && apk del curl + +ENTRYPOINT ["server_linux_amd64"] +CMD ["--help"] diff --git a/kcptun/README.md b/kcptun/README.md new file mode 100644 index 0000000..08c6a84 --- /dev/null +++ b/kcptun/README.md @@ -0,0 +1,53 @@ +kcptun +====== + +[kcptun][1] is an extremely simple & fast udp tunnel based on kcp protocol. + +## How It Works + +![][2] + +## docker-compose.yml + +```yaml +server: + image: vimagick/kcptun + command: + --listen :29900 + --target google-public-dns-a.google.com:53 + ports: + - "29900:29900/udp" + environment: + - KCPTUN_KEY=****** + restart: always + +client: + image: vimagick/kcptun + entrypoint: client_linux_amd64 + command: + --localaddr :12948 + --remoteaddr easypi.info:29900 + ports: + - "12948:12948/tcp" + environment: + - KCPTUN_KEY=****** + restart: always +``` + +## Server Setup + +```bash +$ docker-compose up -d server +$ docker-compose logs -f server +``` + +## Client Setup + +```bash +$ docker-compose up -d client +$ docker-compose logs -f client +$ dig @127.0.0.1 -p 12948 www.google.com +tcp +``` + +[1]: https://github.com/xtaci/kcptun +[2]: https://github.com/xtaci/kcptun/raw/master/kcptun.png diff --git a/kcptun/docker-compose.yml b/kcptun/docker-compose.yml new file mode 100644 index 0000000..9f5fb56 --- /dev/null +++ b/kcptun/docker-compose.yml @@ -0,0 +1,22 @@ +server: + image: vimagick/kcptun + command: + --listen :29900 + --target google-public-dns-a.google.com:53 + ports: + - "29900:29900/udp" + environment: + - KCPTUN_KEY=****** + restart: always + +client: + image: vimagick/kcptun + entrypoint: client_linux_amd64 + command: + --localaddr :12948 + --remoteaddr easypi.info:29900 + ports: + - "12948:12948/tcp" + environment: + - KCPTUN_KEY=****** + restart: always