forked from softwaredownload/openwrt-fanqiang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
469f613
commit 8eaa860
Showing
1 changed file
with
245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
# 简单、高速、稳定的翻墙软件 overtls 安装、使用教程 | ||
|
||
[overtls](https://github.com/ShadowsocksR-Live/overtls) 是 目前较新的 SOCKS5 型代理软件,在软件内部通过 TLS 实现数据传输,同时支持 TCP 和 UDP 流量转发 | ||
|
||
overtls 也可能是目前设计最简洁、使用最简单的翻墙软件 | ||
|
||
因为 GFW 不可能封锁用于互联网传输数据的 TLS 协议,overtls 就用 TLS 传输数据。又因为 TLS 是一种加密协议,所以,GFW 不知道协议传送的数据内容 | ||
|
||
当用户浏览某个网址如 `https://claude.ai` 时, overtls 客户端会访问我们在配置文件里约定的资源 uri,如 `https/domain.com/zyxwvutsrqponmlkjih/`,overtls 服务端向浏览器返回用户想看的内容 | ||
|
||
|
||
## 安装 overtls 的准备工作 | ||
- 一个带公网 IP 的 VPS 主机,必须自行购买 | ||
- 一个域名,可以购买或申请免费的,并将该域名解析到 VPS 主机的 IP 上 | ||
|
||
可以是主域名,如 `domain.com`,也可以是子域名,如 `american.domain.com` | ||
|
||
- 一对 https 证书/私钥,证书可以自行购买,也可以在 Let's Encrypt 申请免费的 | ||
- 一个 http 服务端软件(如 nginx ),并提供用于伪装用途的站点资源或者充当前置的反向代理 | ||
|
||
## Nginx 域名设置举例 | ||
|
||
如果你已经在用一个具有 https 证书的主域名,再在 Nginx 里设置一个子域名用于 overtls 是非常简单的,下面是示例代码,注意,要把个性化内容修改成实际值 | ||
|
||
```shell | ||
server { | ||
server_name american.domain.com; | ||
root /home/name/public/american/; | ||
index index.html index.htm; | ||
|
||
listen [::]:443; # managed by Certbot | ||
listen 443 ssl; # managed by Certbot | ||
ssl_certificate /etc/letsencrypt/live/american.domain.com/fullchain.pem; # managed by Certbot | ||
ssl_certificate_key /etc/letsencrypt/live/american.domain.com/privkey.pem; # managed by Certbot | ||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | ||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | ||
} | ||
``` | ||
|
||
## Ubuntu server 命令行安装 Overtls 服务端 | ||
|
||
```shell | ||
wget https://raw.githubusercontent.com/shadowsocksr-live/overtls/master/install/overtls-install-musl.sh | ||
chmod +x overtls-install-musl.sh | ||
sudo ./overtls-install-musl.sh | ||
``` | ||
|
||
--- | ||
|
||
``` | ||
...自动检查环境,安装依赖 | ||
请输入 你的网站域名 (形如 mygooodsite.com) | ||
Please enter your domain name (for example: mygooodsite.com): american.domain.com | ||
[OK] 正獲取公網 IP, 請耐心等待... | ||
[OK] Obtaining public IP information, please wait patiently... | ||
DNS resolution IP: ... | ||
Local V4 IP: ... | ||
Local V6 IP: ... | ||
[OK] The DNS resolution IP matches local V4 IP | ||
请输入 反向代理入口路径(不带前后斜杠), 默认值 zyxwvutsrqponmlkjih | ||
Please enter reverse proxy path without slashes (default zyxwvutsrqponmlkjih): (注:可回车使用默认值) | ||
请输入 站点端口号 (默认值 443) | ||
Please enter the access port number (default: 443):(注:可回车使用默认值) | ||
Failed to stop overtls.service: Unit overtls.service not loaded. | ||
Failed to disable unit: Unit file overtls.service does not exist. | ||
overtls uninstall success! | ||
[OK] nginx has been installed before this moment | ||
[OK] [nginx] copy files Completed | ||
[OK] [CA] Create account key Completed | ||
[OK] [CA] Create CSR file Completed | ||
Parsing account key... | ||
Parsing CSR... | ||
Found domains: american.domain.com | ||
Getting directory... | ||
Directory found! | ||
Registering account... | ||
Registered! Account ID: ... | ||
Creating new order... | ||
Order created! | ||
Verifying american.domain.com... | ||
american.domain.com verified! | ||
Signing certificate... | ||
Certificate signed! | ||
[OK] [CA] Obtain website certificate Completed | ||
--2024-08-22 06:03:15-- ... | ||
Resolving letsencrypt.org (letsencrypt.org)... | ||
Connecting to letsencrypt.org (letsencrypt.org)|2600:1f1c:471:9d01::c8|:443... connected. | ||
HTTP request sent, awaiting response... 200 OK | ||
Length: 1647 (1.6K) [application/x-pem-file] | ||
Saving to: ‘STDOUT’ | ||
2024-08-22 06:03:15 (21.8 MB/s) - written to stdout [1647/1647] | ||
[OK] [CA] Merger of intermediate certificate and website certificate Completed | ||
--2024-08-22 06:03:16-- ... | ||
Resolving letsencrypt.org (letsencrypt.org) ... | ||
Connecting to letsencrypt.org (letsencrypt.org)|...|:443... connected. | ||
HTTP request sent, awaiting response... 200 OK | ||
Length: 1939 (1.9K) [application/x-pem-file] | ||
Saving to: ‘STDOUT’ | ||
[OK] [CA] Root certificate and intermediate certificate merge Completed | ||
[OK] [CA] Certificate configuration Completed | ||
no crontab for root | ||
[OK] cron scheduled task update Completed | ||
/etc/init.d/overtls starting... | ||
Synchronizing state of overtls.service with SysV service script with /lib/systemd/systemd-sysv-install. | ||
Executing: /lib/systemd/systemd-sysv-install enable overtls | ||
Created symlink /etc/systemd/system/multi-user.target.wants/overtls.service → /lib/systemd/system/overtls.service. | ||
``` | ||
|
||
### 保存自动生成的 overtls 配置文件 config.json | ||
|
||
最后,自动安装程序会在命令行屏幕给出直接可用的配置文件,类似下面: | ||
|
||
|
||
======== config.json ======== | ||
|
||
```json | ||
{ | ||
"remarks": "login-name-mark", | ||
"tunnel_path": "/zyxwvutsrqponmlkjih/", | ||
"test_timeout_secs": 5, | ||
|
||
"server_settings": { | ||
"forward_addr": "http://127.0.0.1:80", | ||
"listen_host": "127.0.0.1", | ||
"listen_port": 321 | ||
}, | ||
|
||
"client_settings": { | ||
"server_host": "20.19.18.17", | ||
"server_port": 443, | ||
"server_domain": "american.domain.com", | ||
"listen_host": "127.0.0.1", | ||
"listen_port": 7654 | ||
} | ||
} | ||
``` | ||
|
||
复制屏幕上的配置,保存到本机为 `config.json` | ||
|
||
另外,屏幕上还显示 ssr,类似下面: | ||
|
||
``` | ||
ssr://... | ||
``` | ||
|
||
把这行内容保存到本机 | ||
|
||
可以把屏幕上显示的 QR code 图片也保存到本机 | ||
|
||
### 检查服务端 overtls 是否在运行: | ||
|
||
```shell | ||
ps ax | grep overtls | ||
9840 ? Sl 0:00 /usr/local/bin/overtls -d -r server -c /etc/overtls/config.json | ||
``` | ||
|
||
上面显示 overtls 正在运行 | ||
|
||
|
||
## 命令行运行 overtls 科学上网教程 | ||
|
||
### Windows 本机安装 Overtls 命令行程序 | ||
|
||
overtls 下载页面: | ||
|
||
<https://github.com/ShadowsocksR-Live/overtls/releases> | ||
|
||
2024-08-22 的下载链接: | ||
|
||
<https://github.com/ShadowsocksR-Live/overtls/releases/download/v0.2.33/overtls-i686-pc-windows-msvc.zip> | ||
|
||
|
||
### 创建日志文件 | ||
|
||
在工作目录里执行命令创建 `.env 文件`,在 Msys bash 里是这样: | ||
|
||
``` | ||
touch .env | ||
``` | ||
|
||
可以通过这个文件查看软件的运行日志 | ||
|
||
### 命令行运行 overtls | ||
|
||
我在 Windows 安装了 Msys Bash,用下面命令运行 overtls | ||
|
||
``` | ||
./overtls.exe -r client -c ./config.json | ||
``` | ||
|
||
### 设置 Chrome 浏览器翻墙 | ||
|
||
接下来我们得告诉浏览器把请求转发到 本机 7654 端口 | ||
|
||
假设你已经安装了 Chrome 浏览器 | ||
|
||
- 按 Windows 键,输入 chrome,在出来的 Google Chrome 图标上点右键 | ||
- 选择 `Open File Location` 打开文件所在位置 | ||
- 这时会打开 Chrome 快捷方式所在文件夹,并默认选中,Ctrl + C 复制 | ||
- 来到桌面,Ctrl + V 粘贴,把刚粘贴的快捷方式重命名为 `Proxy` | ||
- 在 Proxy 图标上右击,选 Properties 属性 | ||
- 在 Target (目标)后面加一个英文空格,再加上下面的内容: | ||
|
||
--proxy-server=socks5://127.0.0.1:7654 | ||
|
||
 | ||
|
||
设置好以后,退出已经打开的 Chrome,点击这个 Proxy(Chrome),然后 浏览 https://youtube.com | ||
|
||
如果设置都正确,应该翻墙无障碍了。这是本浏览器内全局翻墙,不区分国内、国外 IP,挺好,否则打开有些外网会很慢或者根本打不开 | ||
|
||
我们可以让 overtls 随机启动,想翻墙时就用刚才创建的快捷方式打开浏览器 | ||
|
||
## 用 overtls GUI 程序科学上网 | ||
|
||
如果你觉得命令行运行 overtls 稍有不便,那么可以试试 GUI 界面 | ||
|
||
### 下载 overtls 的 GUI 程序 ssrWin | ||
|
||
ssrWin 下载页面: | ||
|
||
<https://github.com/ShadowsocksR-Live/ssrWin/releases> | ||
|
||
2024-08-22 的具体下载链接: | ||
|
||
<https://github.com/ShadowsocksR-Live/ssrWin/releases/download/v0.8.9/ssr-win-x64.zip> | ||
|
||
下载时可能报毒,这时需要设置一下才能下载 | ||
|
||
运行方法: | ||
|
||
- 复制服务器安装 overttls 结束时显示的 ssr 字符串 | ||
- 运行 `ssrWin.exe` | ||
- 在托盘图标点右键,选择 `import URL from clipboard` | ||
- 在托盘图标的右键菜单里选择 `Run` | ||
|
||
然后可以点开 Chrome, Firefox, IE 或 其它浏览器翻墙了,这时已经修改了系统的代理设置, 不用特别在浏览器内部安装代理插件,已经安装的代理插件也请禁用或停用或卸载掉,否则有可能适得其反上不了网 | ||
|
||
### 相关网址 | ||
- <https://github.com/ShadowsocksR-Live/overtls> | ||
- <https://github.com/ShadowsocksR-Live/ssrWin> | ||
- <https://github.com/softwaredownload/openwrt-fanqiang> |