Skip to content

Commit

Permalink
Update README (#49)
Browse files Browse the repository at this point in the history
* Rename README_EN

* Fix some markdownlint warnings

* Change multi language support style

* Fix some typo in Chinese translation

* Fix README translation anchor links typo

* Update README translation and fix some typo

* Fix README translation anchor color

* Fix README_EN typo
  • Loading branch information
Palpitace authored Oct 22, 2024
1 parent 5af29df commit f8ccfd9
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 120 deletions.
95 changes: 0 additions & 95 deletions README-en.md

This file was deleted.

50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
<div align="right">
<a title="简体中文" href="README.md"><img src="https://img.shields.io/badge/-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-A31F34?style=for-the-badge" alt="简体中文" /></a>
<a title="English" href="README_EN.md"><img src="https://img.shields.io/badge/-English-545759?style=for-the-badge" alt="English"></a>
</div>

# mtproxy

这是一个一键安装 MTProxy 代理的绿色脚本,脚本可以在官方版本的 MTProxy 程序和兼容性最强的第三方作者开发的 mtg 程序中进行选择静态安装或者编译,该版本默认支持 Fake TLS 以及 AdTag 配置。

在此基础上,提供了 Nginx 作为前端转发,MTProxy 作为后端代理的方式以实现安全的伪装并且在 nginx 转发层进行配置了 IP 白名单,只有通过白名单认证过的 IP 才可以进行访问,此功能提供了 Docker 镜像以便开箱即用
在此基础上,提供了 Nginx 作为前端转发,MTProxy 作为后端代理的方式以实现安全的伪装并且在 Nginx 转发层进行配置了 IP 白名单,只有通过白名单认证过的 IP 才可以进行访问。

[English](README-en.md)
> 此功能提供了 Docker 镜像以便开箱即用。
## 交流群组

Telegram 群组:https://t.me/EllerHK
Telegram 群组:<https://t.me/EllerHK>

## 安装方式

提供了两种安装方式可供选择:

- 使用脚本
- 使用脚本

选择该方式一般是你在宿主机中进行直接安装或者编译,会或多或少需要安装一些系统基础依赖库。

- 使用 Docker

**小白建议使用 Docker!** 不会对宿主机造成污染,如果你需要修改一些配置文件,需要你稍微学习一些基础Docker 使用技术。
**小白建议使用 Docker!** 不会对宿主机造成污染,如果你需要修改一些配置文件,需要你稍微学习一些基础 Docker 使用技术。

### 使用脚本

> 如果你反复遇到段错误或者其他未知问题, 建议更换为 Debian 9+ 以上的系统或采用 Docker 方式运行.
> 如果你反复遇到错误或者其他未知问题, 建议更换为 Debian 9+ 以上的系统或采用 Docker 方式运行
执行如下代码进行安装

Expand All @@ -36,17 +41,13 @@ bash mtproxy.sh

![mtproxy.sh](https://raw.githubusercontent.com/ellermister/mtproxy/master/mtproxy.jpg)

### 使用Docker | 白名单 MTProxy Docker 镜像

The image integrates nginx and mtproxy+tls to disguise traffic, and uses a whitelist mode to deal with firewall detection.
### 使用 Docker | 白名单 MTProxy Docker 镜像

该镜像集成了 nginx、mtproxy+tls 实现对流量的伪装,并采用**白名单**模式来应对防火墙的检测。

If you use this Docker image, you don't need to use the script, you can choose one of the two, don't mix it up.

若使用该 Docker 镜像, 就不需要用脚本了,二者二选一,不要搞混了。

**如果没有安装Docker**一键安装方式
**如果没有安装Docker**一键安装方式如下

```bash
curl -fsSL https://get.docker.com -o get-docker.sh
Expand All @@ -64,7 +65,9 @@ docker run -d \
-p 8443:443 \
ellermister/mtproxy
```
**镜像默认开启了 IP 段白名单**,如果你不需要可以配置 `ip_white_list="OFF"` 取消:

**镜像默认开启了 IP 段白名单**
如果你不需要可以配置 `ip_white_list="OFF"` 取消:

```bash
docker run -d \
Expand All @@ -80,7 +83,7 @@ ellermister/mtproxy

`ip_white_list` 选项:

- **OFF** 关闭白名单
- **OFF** 关闭白名单
- **IP** 开启 IP 白名单
- **IPSEG** 开启 IP 段白名单

Expand All @@ -94,13 +97,12 @@ docker logs -f mtproxy

连接端口记得修改为你映射后的外部端口,如上文例子中都是`8443`,在连接时修改端口。

更多使用请参考: https://hub.docker.com/r/ellermister/mtproxy
更多使用请参考: <https://hub.docker.com/r/ellermister/mtproxy>

## 使用方式

配置文件 `mtp_config`,如果你想手动修改密钥或者参数请注意格式。


运行服务

```bash
Expand Down Expand Up @@ -151,12 +153,11 @@ rm -rf /home/mtproxy
cd /home/mtproxy && bash mtproxy.sh start > /dev/null 2>&1 &
```


## 计划任务守护

因为默认官方的 mtproxy 程序存在BUG,pid 大于 65535 时处理存在问题。进程容易坏死和异常退出。
由于默认官方的 mtproxy 程序存在BUG,pid 大于 65535 时进程处理存在问题,进程容易坏死和异常退出。

建议通过计划任务去守护进程,编辑方式 `crontab -e`
因此建议通过计划任务去守护进程 `crontab -e`

每分钟检测进程并启动

Expand All @@ -166,14 +167,13 @@ cd /home/mtproxy && bash mtproxy.sh start > /dev/null 2>&1 &

## MTProxy Admin Bot

https://t.me/MTProxybot
<https://t.me/MTProxybot>
> Sorry, an error has occurred during your request. Please try again later.(Code xxxxxx)
如果你在申请绑定代理推广时遇到了此类错误,官方没有给出明确的原因,根据网友反馈,此类问题多出现于账号注册不足与 2~3 年,**建议使用 3 年以上的账号以及未被 banned 的账号。**
如果你在申请绑定代理推广时遇到了此类错误,官方没有给出明确的原因。根据网友反馈,此类问题多出现于账号注册不足与 2~3 年。
**建议使用 3 年以上的账号以及未被 banned 的账号。**

## 引用项目

- https://github.com/TelegramMessenger/MTProxy
- https://github.com/9seconds/mtg


- <https://github.com/TelegramMessenger/MTProxy>
- <https://github.com/9seconds/mtg>
170 changes: 170 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<div align="right">
<a title="简体中文" href="README.md"><img src="https://img.shields.io/badge/-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-545759?style=for-the-badge" alt="简体中文" /></a>
<a title="English" href="README_EN.md"><img src="https://img.shields.io/badge/-English-A31F34?style=for-the-badge" alt="English"></a>
</div>

# mtproxy

MTProxyTLS one-click install lightweight script.
With Nginx as a Forward Proxy, access is only granted with an IP whitelist.

## Discussion

Telegram Group: <https://t.me/EllerHK>

## Install method

- Script

This method generally requires you to install or compile directly on your machine, which may require the installation of some basic system dependency libraries.

- Docker

**Recommended!** Will not broke your system or dependencies. Just need to know some basic Docker knowledge.

### Script

> If you repeatedly encounter errors or other unknown problems, it is recommended to switch to a Debian 9+ system or use Docker.
Execute the following code to install

```bash
rm -rf /home/mtproxy && mkdir /home/mtproxy && cd /home/mtproxy
curl -fsSL -o mtproxy.sh https://github.com/ellermister/mtproxy/raw/master/mtproxy.sh
bash mtproxy.sh
```

![mtproxy.sh](https://raw.githubusercontent.com/ellermister/mtproxy/master/mtproxy.jpg)

### Docker | Whitelist MTProxy Docker Image

The image integrates nginx and mtproxy+tls to disguise traffic, and uses a **white-list** mode to deal with firewall detection.

If you use this Docker image, you don't need to use the script anymore, you can choose one of the two, don't mix it up.

**If you didn't install Docker before**, below is the install script:

```bash
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
```

**Start the container with whitelist:**

```bash
docker run -d \
--name mtproxy \
--restart=always \
-e domain="cloudflare.com" \
-p 8080:80 \
-p 8443:443 \
ellermister/mtproxy
```

**The image enabled the IP segment whitelist by default.**
If you don't need it, you can cancel it:

```bash
docker run -d \
--name mtproxy \
--restart=always \
-e domain="cloudflare.com" \
-e secret="548593a9c0688f4f7d9d57377897d964" \
-e ip_white_list="OFF" \
-p 8080:80 \
-p 8443:443 \
ellermister/mtproxy
```

`ip_white_list` :

- **OFF** disable whitelist
- **IP** enable IP whitelist
- **IPSEG** enable IPSEG whitelist

`secret`:If you want to create a known key, the format is: 32 hexadecimal characters.

**View the parameter configuration of the link in the log**:

```bash
docker logs -f mtproxy
```

Please change the HOST_PORT which is for the connection, the HOST_PORT in the above example is `8443`.

For more usage: <https://hub.docker.com/r/ellermister/nginx-mtproxy>

## Usage

Configuration file `mtp_config`, pay attention to the format if you want to change secret manually.

Start service

```bash
 bash mtproxy.sh start
```

Debug service

```bash
bash mtproxy.sh debug
```

Stop service

```bash
bash mtproxy.sh stop
```

Restart service

```bash
bash mtproxy.sh restart
```

Reinstall/Reconfigure

```bash
bash mtproxy.sh reinstall
```

## Uninstall

Just delete the directory where it is located.

```bash
rm -rf /home/mtproxy
```

## Run on Startup

Edit `/etc/rc.local` and add the following code to the script:

```bash
cd /home/mtproxy && bash mtproxy.sh start > /dev/null 2>&1 &
```

## Crontab

Due to the bug in the official mtproxy, there are problems with process processing when the pid is over 65535, and the process is prone to necrosis and abnormal exit.

Therefore, it is recommended to monitor the process through scheduled tasks `crontab -e`:

Check the process and start it every minute

```bash
* * * * * cd /home/mtproxy && bash mtproxy.sh start > /dev/null 2>&1 &
```

## MTProxy Admin Bot

<https://t.me/MTProxybot>
> Sorry, an error has occurred during your request. Please try again later.(Code xxxxxx)
If you encounter such an error when applying for binding agent promotion, the official does not give a clear reason. According to feedback from netizens, such problems mostly occur due to insufficient account registration and 2 to 3 years.
**It is recommended to use accounts that are more than 3 years old and accounts that have not been banned.**

## Open Source Used

- <https://github.com/TelegramMessenger/MTProxy>
- <https://github.com/9seconds/mtg>

0 comments on commit f8ccfd9

Please sign in to comment.