系统 必须 Ubuntu 16 64位的。
1、Ubuntu 使用 shadowsocks Flip the wall
安装:
在终端下执行命令安装:
apt-get install python-pip
pip install shadowsocks
配置:
创建 /etc/shadowsocks.json 文件, 内容如下
{
"server": "XXX.XXX.XXX.XXX",
"server_port": XXXX,
"local_address":"127.0.0.1",
"local_port":1080,
"password": "XXXXXX",
"method": "rc4-md5",
"timeout":300,
"fast_open":false
}
启动ss客户端:
sslocal -c /etc/shadowsocks.json
http代理:
终端安装Polipo
sudo apt-get install polipo
修改配置文件/etc/polipo/config,内容如下
# This file only needs to list configuration variables that deviate
# from the default values. See /usr/share/doc/polipo/examples/config.sample
# and "polipo -v" for variables you can tweak and further information.
logSyslog = true
logFile = /var/log/polipo/polipo.log
socksParentProxy = "127.0.0.1:1080"
socksProxyType = socks5
chunkHighMark = 50331648
objectHighMark = 16384
serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32
proxyAddress = "0.0.0.0"
proxyPort = 8123
开启新终端,重启Polipo
/etc/init.d/polipo restart
浏览器设置(可选):
Firefox中,首选项—常规—网络代理 中设置:
创建脚步:
方便使用,创建 shadow.sh 脚步
#!/bin/bash
#shadow.sh
sslocal -c /etc/shadowsocks.json
每次 Flip the wall 时候,在新终端中启动,shadow.sh 即可。
2、编译 CEF
设置终端 Flip the wall:
这里 打开一个终端 实行 shadow.sh
打开另一个终端(以后操作都在该终端完成),实行:
export http_proxy=http://127.0.0.1:8123
export https_proxy=http://127.0.0.1:8123
创建目录:
这里cef代码目录 为 /home/system/cef 中
在cef目录中创建文件夹:
mkdir ~/cef/automate
mkdir ~/cef/chromium_git
下载运行脚步:install-build-deps.sh
cd ~/cef
sudo apt-get install curl
curl 'https://chromium.googlesource.com/chromium/src/+/master/build/install-build-deps.sh?format=TEXT' | base64 -d > install-build-deps.sh
chmod 755 install-build-deps.sh
sudo ./install-build-deps.sh
安装 libgtkglext1-dev:
sudo apt-get install libgtkglext1-dev
下载安装 depot_tools:
使用git 下载 depot_tools
cd ~/cef
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
设置 depot_tools 环境变量:
export PATH=/home/system/cef/depot_tools:$PATH
下载cef代码:
下载 automate-git.py ,使用 automate-git.py 来中git中下载的cef
cd ~/cef/automate
wget https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py
创建 ~/cef/chromium_git/update.sh
#!/bin/bash
python ../automate/automate-git.py --download-dir=/home/system/cef/chromium_git --depot-tools-dir=/home/system/cef/depot_tools --no-distrib --no-build
终端执行刚刚创建的update.sh,下载cef代码
cd ~/cef/chromium_git
chmod 755 update.sh
./update.sh
下载漫长... 这里有从git上下载的 depot_tools工具 和 cef 代码 。可以直接拷贝过来就用,不过别忘了设置depot_tools的环境变量。
获取第三方库代码:
cd ~/cef/chromium_git/chromium/src
gclient sync
创建 Ninja 工程文件
创建 ~/cef/chromium_git/chromium/src/cef/create.sh 文件,文件内容
#!/bin/bash
./cef_create_projects.sh
执行该脚步
cd ~/cef/chromium_git/chromium/src/cef
chmod 755 create.sh
./create.sh
创建沙箱:
cd ~/cef/chromium_git/chromium/src
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
sudo BUILDTYPE=Debug_GN_x64 ./build/update-linux-sandbox.sh
Ninja 编译 cef/chromium
cd ~/cef/chromium_git/chromium/src
ninja -C out/Debug_GN_x64 cef chrome_sandbox
posted on 2018-09-12 11:57
vic.MINg 阅读(1667)
评论(0) 编辑 收藏 引用 所属分类:
Linux