forked from mirror/NitWikit
commit
7b9626cc47
@ -11,15 +11,100 @@ sidebar_position: 5
|
||||
|
||||
**来几个?**
|
||||
|
||||
内网穿透一抓一大把
|
||||
|
||||
比如比较有名的樱花内网穿透:https://www.natfrp.com/?page=panel&module=addproxy
|
||||
内网穿透一抓一大把,比如[樱花内网穿透](https://www.natfrp.com/)和[OpenFrp](https://www.openfrp.net/)
|
||||
|
||||
~~因为rz用户比较多,你甚至能用某人用不用樱花来定性判断这人有没有技术~~
|
||||
|
||||
openFrp:https://www.openfrp.net/
|
||||
## 自建Frp
|
||||
|
||||
首先你得确保你有一台有公网IP的机器,最好是**Linux**的。
|
||||
|
||||
这里假定你有一台符合条件的Linux服务器,并且你已经可以连上你服务器的**SSH**。
|
||||
|
||||
|
||||
1. 首先确保服务器所有软件包是最新的:
|
||||
|
||||
```bash
|
||||
apt-get update && apt-get upgrade -y
|
||||
```
|
||||
|
||||
2. 安装`screen`软件包:
|
||||
|
||||
```bash
|
||||
apt-get install screen -y
|
||||
```
|
||||
|
||||
3. 下载`frp.go`软件:
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
wget https://github.com/fatedier/frp/releases/download/v0.58.1/frp_0.58.1_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
4. 解压
|
||||
|
||||
```bash
|
||||
tar -xzvf frp_0.58.1_linux_amd64.tar.gz
|
||||
```
|
||||
|
||||
### 配置服务端
|
||||
|
||||
1. 编写配置文件:
|
||||
```bash
|
||||
vim ~/frp_0.58.1_linux_amd64/frps.toml
|
||||
```
|
||||
写入如下内容:
|
||||
```toml
|
||||
bindPort = 7000 # frps监听的端口
|
||||
|
||||
auth.token = "example" # 身份验证令牌,frpc要与frps一致
|
||||
```
|
||||
|
||||
2. 开启frps服务端:
|
||||
|
||||
```bash
|
||||
cd ~/frp_0.58.1_linux_amd64
|
||||
screen -dR frps ./frps
|
||||
# 键盘上按Ctrl+A+D退出
|
||||
```
|
||||
|
||||
### 配置客户端:
|
||||
|
||||
1. 编辑配置文件
|
||||
```bash
|
||||
vim ~/frp_0.58.1_linux_amd64/frpc.toml
|
||||
```
|
||||
输入以下内容:
|
||||
```toml
|
||||
serverAddr = "x.x.x.x" # 你frps服务器的ip地址
|
||||
serverPort = 7000 # 你frps服务开在的端口
|
||||
|
||||
auth.token = "example" # 令牌,与公网服务端保持一致
|
||||
|
||||
[[proxies]]
|
||||
name = "mc je"
|
||||
type = "tcp" # java版使用tcp协议通信,不可更改
|
||||
localIP = "127.0.0.1" # 默认不用改
|
||||
localPort = 25565 # mc服务端开在哪个端口?
|
||||
remotePort = 25565 # 暴露服务的公网入口
|
||||
|
||||
# 如果你开了互通,要基岩支持
|
||||
[[proxies]]
|
||||
name = "mc be"
|
||||
type = "udp" # 基岩版使用udp协议通信,不可更改
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 19132
|
||||
remotePort = 19132
|
||||
```
|
||||
|
||||
2. 开启frps服务端:
|
||||
|
||||
```bash
|
||||
cd ~/frp_0.58.1_linux_amd64
|
||||
screen -dR frpc ./frpc
|
||||
# 键盘上按Ctrl+A+D退出
|
||||
```
|
||||
|
||||
TODO:自建Frp
|
||||
|
||||
## 可能的问题?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user