Total Pageviews

Friday, 30 March 2018

翻墙工具-fakio


A lightweight secure tunnel proxy.

from https://github.com/SerhoLiu/fakio
----------

我的说明

使用方法:
首先linux vps上搭建rust环境:

curl https://sh.rustup.rs -sSf | sh
会显示:

Welcome to Rust!


This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  /root/.cargo/bin


This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /root/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation       


然后运行:
source $HOME/.cargo/env   

 
这样,
rust环境就搭建好了)

然后,git clone https://github.com/SerhoLiu/fakio
cd fakio
cargo build --release
(等cargo build --release运行完毕后,会在当前目录下生成target目录)
cd target/release

root@ar:~/fakio/target/release# ls
build  deps     fakio-client     fakio-server     incremental  libfakio.rlib

examples  fakio-client.d  fakio-server.d  libfakio.d   native
(fakio-server就是我们所需要的可执行文件)
root@ar:~/fakio/target/release# mv ~/fakio/conf/ ./
(之所以要把~/fakio/conf/目录移动到~/fakio/target/release/目录,是因为~/fakio/target/release/目录下的可执行文件fakio-server默认要读取它所在目录下的conf/server.toml文件)
root@ar:~/fakio/target/release# cat conf/server.toml
[server]
listen = "127.0.0.1:8888"

[users]
serho = "123456"
root@ar:~/fakio/target/release# nano
conf/server.toml
(把127.0.0.1改为0.0.0.0 ,8888端口你愿意改为其他端口也行。serho = "123456" ,分别表示用户名和密码,你想修改它们也行。)
root@ar:~/fakio/target/release#./fakio-server
(不过fakio-server是运行在前台的,容易退出,我们可以利用daemonize来让它运行在后台:
root@ar:~/fakio/target/release# daemonize -c . /root/fakio/target/release/fakio-server)
这样,服务器端就搭建好了。

在客户机器mac上, 先按上面的蓝色文字搭建rust环境。
然后,git clone https://github.com/SerhoLiu/fakio
cd fakio
cargo build --release (这一步搞不定,都是gfw惹的祸,有的包下载不下来,所以运行此步之前,挂个vpn或者用privoxy把ss这样的socks代理转换为http proxy,然后在terminal里运行:
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118 )
cargo build --release运行完毕后,会在当前目录下生成target目录.
cd target/release

yudeMacBook-Air:release brite$ ls
build        examples    fakio-server    libfakio.d
conf        fakio-client    fakio-server.d    libfakio.rlib
deps        fakio-client.d    incremental    native
yudeMacBook-Air:release brite$
mv ~/fakio/conf/ ./
(之所以要把~/fakio/conf/目录移动到~/fakio/target/release/目录,是因为~/fakio/target/release/目录下的可执行文件fakio-client默认要读取它所在目录下的conf/client.toml文件)
yudeMacBook-Air:release brite$ nano conf/client.toml
(修改server行的127.0.0.1为你服务器的公网ip ,修改listen行的1080为1082)
yudeMacBook-Air:release brite$ ./fakio-client

然后设置浏览器的socks5代理服务器为127.0.0.1:1082 ,浏览器即可翻墙。

https://github.com/serholiu/fakio/releases ,如果你不想编译服务器端/客户端,你可到此下载已编译好的服务器端/客户端程序。

No comments:

Post a Comment