- 简单拓扑结构:国内-(ocserv)-国内中转服务器-(shadowvpn)-国外服务器
- 实验环境:用户终端为iPhone,中转服务器及国外服务器均为Ubuntu 14.04
- 搭建Ocserv
- 打开
ftp://ftp.infradead.org/pub/ocserv/找到最新版本并下载、解压 - 安装依赖:
- 打开
| #!/bin/bash -x | |
| ## 让 privoxy 代理服务器使用 gfwlist 自动分流 | |
| ## 安装需要的包,gfwlist2privoxy 暂时只支持 py2.7 所以需要修改下:: | |
| # sudo apt install -y privoxy python-pip | |
| # pip install --user gfwlist2privoxy | |
| # sed -i 's,^#!/usr/bin/python.*,#!/usr/bin/python2.7,' ~/.local/bin/gfwlist2privoxy | |
| ## 修改 privoxy 配置,默认使用 8123 本地端口 | |
| grep -q gfwlist.action /etc/privoxy/config || echo 'actionsfile gfwlist.action' | sudo tee -a /etc/privoxy/config |
| #!/bin/bash | |
| for port in {1..9999}; do | |
| echo -n "TCP $port: " | |
| result=$(nc "$1" "$port" -w 1 2>&1 < /dev/null) | |
| if [ "$?" -eq 0 ]; then | |
| echo "Open" | |
| continue | |
| fi | |
| if [[ "$result" == *refused* ]]; then |
| #!/bin/bash | |
| #################################################### | |
| # # | |
| # This is a ocserv installation for CentOS 7 # | |
| # Version: 1.1.1 20140803 # | |
| # Author: Travis Lee # | |
| # Website: http://www.stunnel.info # | |
| # # | |
| #################################################### |
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <!DOCTYPE html> | |
| <html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> | |
| <head> | |
| <meta charset='UTF-8'/> | |
| <meta content='width=device-width' name='viewport'/> | |
| <b:include data='blog' name='all-head-content'/> | |
| <link href='//fonts.googleapis.com/css?family=Merriweather%3A300%2C400%2C700' media='all' rel='stylesheet' type='text/css'/> | |
| <link href='//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet'/> |