1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-25 02:04:06 +02:00

add fteproxy

This commit is contained in:
kev 2015-05-27 07:14:55 +08:00
parent 49fda6573e
commit 76c0c40451
3 changed files with 132 additions and 0 deletions

46
fteproxy/Dockerfile Normal file
View File

@ -0,0 +1,46 @@
#
# Dockerfile for fteproxy
#
FROM debian:jessie
MAINTAINER kev<noreply@datageek.info>
ENV FTE_VER 0.2.18
ENV FTE_SYS linux
ENV FTE_ARCH x86_64
ENV FTE_URL https://fteproxy.org/dist/${FTE_VER}/fteproxy-${FTE_VER}-${FTE_SYS}-${FTE_ARCH}.tar.gz
ENV FTE_FILE fteproxy.tar.gz
ENV FTE_MD5 81e1f941df9fa202c08dd73d5def0d33
RUN apt-get update \
&& apt-get install -y curl \
&& curl -sSL ${FTE_URL} -o ${FTE_FILE} \
&& echo "${FTE_MD5} ${FTE_FILE}" | md5sum -c \
&& mkdir -p /fteproxy \
&& tar xzf ${FTE_FILE} --strip 1 -C /fteproxy \
&& rm -rf ${FTE_FILE} /var/lib/apt/lists/*
ENV MODE server
ENV UPSTREAM_FORMAT manual-http-request
ENV DOWNSTREAM_FORMAT manual-http-response
ENV CLIENT_IP 127.0.0.1
ENV CLIENT_PORT 8079
ENV SERVER_IP 127.0.0.1
ENV SERVER_PORT 8080
ENV PROXY_IP 127.0.0.1
ENV PROXY_PORT 8081
ENV RELEASE 20131224
ENV KEY FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
CMD /fteproxy/fteproxy.bin --mode $MODE \
--upstream-format $UPSTREAM_FORMAT \
--downstream-format $DOWNSTREAM_FORMAT \
--client_ip $CLIENT_IP \
--client_port $CLIENT_PORT \
--server_ip $SERVER_IP \
--server_port $SERVER_PORT \
--proxy_ip $PROXY_IP \
--proxy_port $PROXY_PORT \
--release $RELEASE \
--key $KEY

63
fteproxy/README.md Normal file
View File

@ -0,0 +1,63 @@
`fteproxy` provides transport-layer protection to resist keyword filtering,
censorship and discriminatory routing policies.
Its job is to relay datastreams, such as web browsing traffic,
by encoding streams as messages that match a user-specified regular expression.
fteproxy is fast, free, open source, and cross platform.
In the following example, I will setup a server/client pair to connect www.google.com:80.
## Create a docker-compose.yml
```
server:
image: vimagick/fteproxy
ports:
- "80"
environment:
- "MODE=server"
- "SERVER_IP=0.0.0.0"
- "SERVER_PORT=80"
- "PROXY_IP=www.google.com"
- "PROXY_PORT=80"
client:
image: vimagick/fteproxy
ports:
- "9009:80"
links:
- server
environment:
- "MODE=client"
- "SERVER_IP=server"
- "SERVER_PORT=80"
- "CLIENT_IP=0.0.0.0"
- "CLIENT_PORT=80"
```
## Run fteproxy server/client
```
$ docker-compose up -d
Creating fteproxy_server_1...
Creating fteproxy_client_1...
$ docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------
fteproxy_client_1 /bin/sh -c /fteproxy/ftepr ... Up 0.0.0.0:9009->80/tcp
fteproxy_server_1 /bin/sh -c /fteproxy/ftepr ... Up 0.0.0.0:32768->80/tcp
```
## Test with curl
```
$ curl http://localhost:9009/
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
```

View File

@ -0,0 +1,23 @@
server:
image: vimagick/fteproxy
ports:
- "80"
environment:
- "MODE=server"
- "SERVER_IP=0.0.0.0"
- "SERVER_PORT=80"
- "PROXY_IP=www.google.com"
- "PROXY_PORT=80"
client:
image: vimagick/fteproxy
ports:
- "9009:80"
links:
- server
environment:
- "MODE=client"
- "SERVER_IP=server"
- "SERVER_PORT=80"
- "CLIENT_IP=0.0.0.0"
- "CLIENT_PORT=80"