---
title: "frp"
weight: 10
description: "快速反向代理工具"
date: "2026-03-24T16:29:46+08:00"
lastmod: "2026-03-24T16:29:46+08:00"
---

## frp

frp (Fast Reverse Proxy) 是一款快速反向代理工具，用于内网穿透和端口转发。

## 基础使用

### 服务端配置 (frps.ini)
```ini
[common]
bind_port = 7000
token = your_token
```

### 客户端配置 (frpc.ini)
```ini
[common]
server_addr = x.x.x.x
server_port = 7000
token = your_token

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
```

### 启动服务端
```bash
./frps -c frps.ini
```

### 启动客户端
```bash
./frpc -c frpc.ini
```

### 连接内网 SSH
```bash
ssh -p 6000 user@x.x.x.x
```

## 功能特性

- **内网穿透** - 访问内网服务
- **端口转发** - TCP/UDP 转发
- **HTTP 代理** - HTTP/HTTPS 反向代理
- **P2P 模式** - 点对点直连
- **加密传输** - 支持 TLS 加密

## 代理类型

| 类型 | 描述 |
|------|------|
| tcp | TCP 端口转发 |
| udp | UDP 端口转发 |
| http | HTTP 反向代理 |
| https | HTTPS 反向代理 |
| stcp | 安全 TCP 模式 |
| xtcp | P2P TCP 模式 |

## 使用示例

```bash
# HTTP 代理配置
[web]
type = http
local_port = 80
custom_domains = www.example.com

# HTTPS 代理
[web-https]
type = https
local_port = 443
custom_domains = secure.example.com

# P2P 模式
[secret-tcp]
type = stcp
sk = secret_key
local_ip = 127.0.0.1
local_port = 22
```

## 参考资源

- [frp GitHub](https://github.com/fatedier/frp)