dockerfiles/fteproxy
Pratik raj b113da5d19 chore: Use --no-cache-dir flag to pip in Dockerfiles, to save space
Using "--no-cache-dir" flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2021-07-02 01:02:49 +05:30
..
arm chore: Use --no-cache-dir flag to pip in Dockerfiles, to save space 2021-07-02 01:02:49 +05:30
Dockerfile chore: Use --no-cache-dir flag to pip in Dockerfiles, to save space 2021-07-02 01:02:49 +05:30
Dockerfile.debian swith to new domain: easypi.pro 2017-05-08 07:05:07 +08:00
README.md update fteproxy 2017-09-02 13:45:27 +08:00
docker-compose.yml update fteproxy 2017-09-02 13:45:27 +08:00

fteproxy

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. It works very well with vimagick/openvpn(TCP mode).

In the following example, I will setup a server/client pair to connect www.google.com:80.

Internet Censorship

The problem

before

The solution

after

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
    - KEY=CB2FBA2BC70490526E749E01BB050F6B555964290DFF58CF24785B4A093F7B18

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
    - KEY=CB2FBA2BC70490526E749E01BB050F6B555964290DFF58CF24785B4A093F7B18

To generate random key:
xxd -u -p -c32 /dev/urandom | head -n1

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>