mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
update doc (#3512)
This commit is contained in:
parent
fc4e787fe2
commit
88c7e8bf7c
69
README.md
69
README.md
@ -25,9 +25,11 @@ frp also offers a P2P connect mode.
|
|||||||
<!-- vim-markdown-toc GFM -->
|
<!-- vim-markdown-toc GFM -->
|
||||||
|
|
||||||
* [Development Status](#development-status)
|
* [Development Status](#development-status)
|
||||||
|
* [About V2](#about-v2)
|
||||||
* [Architecture](#architecture)
|
* [Architecture](#architecture)
|
||||||
* [Example Usage](#example-usage)
|
* [Example Usage](#example-usage)
|
||||||
* [Access your computer in a LAN network via SSH](#access-your-computer-in-a-lan-network-via-ssh)
|
* [Access your computer in a LAN network via SSH](#access-your-computer-in-a-lan-network-via-ssh)
|
||||||
|
* [Multiple SSH services sharing the same port](#multiple-ssh-services-sharing-the-same-port)
|
||||||
* [Accessing Internal Web Services with Custom Domains in LAN](#accessing-internal-web-services-with-custom-domains-in-lan)
|
* [Accessing Internal Web Services with Custom Domains in LAN](#accessing-internal-web-services-with-custom-domains-in-lan)
|
||||||
* [Forward DNS query requests](#forward-dns-query-requests)
|
* [Forward DNS query requests](#forward-dns-query-requests)
|
||||||
* [Forward Unix Domain Socket](#forward-unix-domain-socket)
|
* [Forward Unix Domain Socket](#forward-unix-domain-socket)
|
||||||
@ -89,6 +91,20 @@ We are currently working on version 2 and attempting to perform some code refact
|
|||||||
|
|
||||||
We will transition from version 0 to version 1 at the appropriate time and will only accept bug fixes and improvements, rather than big feature requests.
|
We will transition from version 0 to version 1 at the appropriate time and will only accept bug fixes and improvements, rather than big feature requests.
|
||||||
|
|
||||||
|
### About V2
|
||||||
|
|
||||||
|
The overall situation is currently unfavorable, and there is significant pressure in both personal and professional aspects.
|
||||||
|
|
||||||
|
The complexity and difficulty of the v2 version are much higher than anticipated. I can only work on its development during fragmented time periods, and the constant interruptions disrupt productivity significantly. Given this situation, we will continue to optimize and iterate on the current version until we have more free time to proceed with the major version overhaul.
|
||||||
|
|
||||||
|
The concept behind v2 is based on my years of experience and reflection in the cloud-native domain, particularly in K8s and ServiceMesh. Its core is a modernized four-layer and seven-layer proxy, similar to envoy. This proxy itself is highly scalable, not only capable of implementing the functionality of intranet penetration but also applicable to various other domains. Building upon this highly scalable core, we aim to implement all the capabilities of frp v1 while also addressing the functionalities that were previously unachievable or difficult to implement in an elegant manner. Furthermore, we will maintain efficient development and iteration capabilities.
|
||||||
|
|
||||||
|
In addition, I envision frp itself becoming a highly extensible system and platform, similar to how we can provide a range of extension capabilities based on K8s. In K8s, we can customize development according to enterprise needs, utilizing features such as CRD, controller mode, webhook, CSI, and CNI. In frp v1, we introduced the concept of server plugins, which implemented some basic extensibility. However, it relies on a simple HTTP protocol and requires users to start independent processes and manage them on their own. This approach is far from flexible and convenient, and real-world demands vary greatly. It is unrealistic to expect a non-profit open-source project maintained by a few individuals to meet everyone's needs.
|
||||||
|
|
||||||
|
Finally, we acknowledge that the current design of modules such as configuration management, permission verification, certificate management, and API management is not modern enough. While we may carry out some optimizations in the v1 version, ensuring compatibility remains a challenging issue that requires a considerable amount of effort to address.
|
||||||
|
|
||||||
|
We sincerely appreciate your support for frp.
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
![architecture](/doc/pic/architecture.png)
|
![architecture](/doc/pic/architecture.png)
|
||||||
@ -140,6 +156,56 @@ Note that the `local_port` (listened on the client) and `remote_port` (exposed o
|
|||||||
|
|
||||||
`ssh -oPort=6000 test@x.x.x.x`
|
`ssh -oPort=6000 test@x.x.x.x`
|
||||||
|
|
||||||
|
### Multiple SSH services sharing the same port
|
||||||
|
|
||||||
|
This example implements multiple SSH services exposed through the same port using a proxy of type tcpmux. Similarly, as long as the client supports the HTTP Connect proxy connection method, port reuse can be achieved in this way.
|
||||||
|
|
||||||
|
1. Deploy frps on a machine with a public IP and modify the frps.ini file. Here is a simplified configuration:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[common]
|
||||||
|
bind_port = 7000
|
||||||
|
tcpmux_httpconnect_port = 5002
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Deploy frpc on the internal machine A with the following configuration:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[common]
|
||||||
|
server_addr = x.x.x.x
|
||||||
|
server_port = 7000
|
||||||
|
|
||||||
|
[ssh1]
|
||||||
|
type = tcpmux
|
||||||
|
multiplexer = httpconnect
|
||||||
|
custom_domains = machine-a.example.com
|
||||||
|
local_ip = 127.0.0.1
|
||||||
|
local_port = 22
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Deploy another frpc on the internal machine B with the following configuration:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[common]
|
||||||
|
server_addr = x.x.x.x
|
||||||
|
server_port = 7000
|
||||||
|
|
||||||
|
[ssh2]
|
||||||
|
type = tcpmux
|
||||||
|
multiplexer = httpconnect
|
||||||
|
custom_domains = machine-b.example.com
|
||||||
|
local_ip = 127.0.0.1
|
||||||
|
local_port = 22
|
||||||
|
```
|
||||||
|
|
||||||
|
4. To access internal machine A using SSH ProxyCommand, assuming the username is "test":
|
||||||
|
|
||||||
|
`ssh -o 'proxycommand socat - PROXY:x.x.x.x:machine-a.example.com:22,proxyport=5002' test@machine-a`
|
||||||
|
|
||||||
|
5. To access internal machine B, the only difference is the domain name, assuming the username is "test":
|
||||||
|
|
||||||
|
`ssh -o 'proxycommand socat - PROXY:x.x.x.x:machine-b.example.com:22,proxyport=5002' test@machine-b`
|
||||||
|
|
||||||
### Accessing Internal Web Services with Custom Domains in LAN
|
### Accessing Internal Web Services with Custom Domains in LAN
|
||||||
|
|
||||||
Sometimes we need to expose a local web service behind a NAT network to others for testing purposes with our own domain name.
|
Sometimes we need to expose a local web service behind a NAT network to others for testing purposes with our own domain name.
|
||||||
@ -155,6 +221,8 @@ Unfortunately, we cannot resolve a domain name to a local IP. However, we can us
|
|||||||
vhost_http_port = 8080
|
vhost_http_port = 8080
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you want to configure an https proxy, you need to set up the `vhost_https_port`.
|
||||||
|
|
||||||
2. Start `frps`:
|
2. Start `frps`:
|
||||||
|
|
||||||
`./frps -c ./frps.ini`
|
`./frps -c ./frps.ini`
|
||||||
@ -280,6 +348,7 @@ You may substitute `https2https` for the plugin, and point the `plugin_local_add
|
|||||||
[common]
|
[common]
|
||||||
server_addr = x.x.x.x
|
server_addr = x.x.x.x
|
||||||
server_port = 7000
|
server_port = 7000
|
||||||
|
vhost_https_port = 443
|
||||||
|
|
||||||
[test_https2http]
|
[test_https2http]
|
||||||
type = https
|
type = https
|
||||||
|
29
README_zh.md
29
README_zh.md
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
[README](README.md) | [中文文档](README_zh.md)
|
[README](README.md) | [中文文档](README_zh.md)
|
||||||
|
|
||||||
frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。
|
frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议,且支持 P2P 通信。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。
|
||||||
|
|
||||||
<h3 align="center">Gold Sponsors</h3>
|
<h3 align="center">Gold Sponsors</h3>
|
||||||
<!--gold sponsors start-->
|
<!--gold sponsors start-->
|
||||||
@ -20,12 +20,13 @@ frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP
|
|||||||
|
|
||||||
通过在具有公网 IP 的节点上部署 frp 服务端,可以轻松地将内网服务穿透到公网,同时提供诸多专业的功能特性,这包括:
|
通过在具有公网 IP 的节点上部署 frp 服务端,可以轻松地将内网服务穿透到公网,同时提供诸多专业的功能特性,这包括:
|
||||||
|
|
||||||
* 客户端服务端通信支持 TCP、KCP 以及 Websocket 等多种协议。
|
* 客户端服务端通信支持 TCP、QUIC、KCP 以及 Websocket 等多种协议。
|
||||||
* 采用 TCP 连接流式复用,在单个连接间承载更多请求,节省连接建立时间。
|
* 采用 TCP 连接流式复用,在单个连接间承载更多请求,节省连接建立时间,降低请求延迟。
|
||||||
* 代理组间的负载均衡。
|
* 代理组间的负载均衡。
|
||||||
* 端口复用,多个服务通过同一个服务端端口暴露。
|
* 端口复用,多个服务通过同一个服务端端口暴露。
|
||||||
* 多个原生支持的客户端插件(静态文件查看,HTTP、SOCK5 代理等),便于独立使用 frp 客户端完成某些工作。
|
* 支持 P2P 通信,流量不经过服务器中转,充分利用带宽资源。
|
||||||
* 高度扩展性的服务端插件系统,方便结合自身需求进行功能扩展。
|
* 多个原生支持的客户端插件(静态文件查看,HTTPS/HTTP 协议转换,HTTP、SOCK5 代理等),便于独立使用 frp 客户端完成某些工作。
|
||||||
|
* 高度扩展性的服务端插件系统,易于结合自身需求进行功能扩展。
|
||||||
* 服务端和客户端 UI 页面。
|
* 服务端和客户端 UI 页面。
|
||||||
|
|
||||||
## 开发状态
|
## 开发状态
|
||||||
@ -34,10 +35,24 @@ frp 目前已被很多公司广泛用于测试、生产环境。
|
|||||||
|
|
||||||
master 分支用于发布稳定版本,dev 分支用于开发,您可以尝试下载最新的 release 版本进行测试。
|
master 分支用于发布稳定版本,dev 分支用于开发,您可以尝试下载最新的 release 版本进行测试。
|
||||||
|
|
||||||
我们正在进行 v2 大版本的开发,将会尝试在各个方面进行重构和升级,且不会与 v1 版本进行兼容,预计会持续一段时间。
|
我们正在进行 v2 大版本的开发,将会尝试在各个方面进行重构和升级,且不会与 v1 版本进行兼容,预计会持续较长的一段时间。
|
||||||
|
|
||||||
现在的 v0 版本将会在合适的时间切换为 v1 版本并且保证兼容性,后续只做 bug 修复和优化,不再进行大的功能性更新。
|
现在的 v0 版本将会在合适的时间切换为 v1 版本并且保证兼容性,后续只做 bug 修复和优化,不再进行大的功能性更新。
|
||||||
|
|
||||||
|
### 关于 v2 的一些说明
|
||||||
|
|
||||||
|
当前整体形势不佳,面临的生活工作压力很大。
|
||||||
|
|
||||||
|
v2 版本的复杂度和难度比我们预期的要高得多。我只能利用零散的时间进行开发,而且由于上下文经常被打断,效率极低。由于这种情况可能会持续一段时间,我们仍然会在当前版本上进行一些优化和迭代,直到我们有更多空闲时间来推进大版本的重构。
|
||||||
|
|
||||||
|
v2 的构想是基于我多年在云原生领域,特别是在 K8s 和 ServiceMesh 方面的工作经验和思考。它的核心是一个现代化的四层和七层代理,类似于 envoy。这个代理本身高度可扩展,不仅可以用于实现内网穿透的功能,还可以应用于更多领域。在这个高度可扩展的内核基础上,我们将实现 frp v1 中的所有功能,并且能够以一种更加优雅的方式实现原先架构中无法实现或不易实现的功能。同时,我们将保持高效的开发和迭代能力。
|
||||||
|
|
||||||
|
除此之外,我希望 frp 本身也成为一个高度可扩展的系统和平台,就像我们可以基于 K8s 提供一系列扩展能力一样。在 K8s 上,我们可以根据企业需求进行定制化开发,例如使用 CRD、controller 模式、webhook、CSI 和 CNI 等。在 frp v1 中,我们引入了服务端插件的概念,实现了一些简单的扩展性。但是,它实际上依赖于简单的 HTTP 协议,并且需要用户自己启动独立的进程和管理。这种方式远远不够灵活和方便,而且现实世界的需求千差万别,我们不能期望一个由少数人维护的非营利性开源项目能够满足所有人的需求。
|
||||||
|
|
||||||
|
最后,我们意识到像配置管理、权限验证、证书管理和管理 API 等模块的当前设计并不够现代化。尽管我们可能在 v1 版本中进行一些优化,但确保兼容性是一个令人头疼的问题,需要投入大量精力来解决。
|
||||||
|
|
||||||
|
非常感谢您对 frp 的支持。
|
||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
完整文档已经迁移至 [https://gofrp.org](https://gofrp.org/docs)。
|
完整文档已经迁移至 [https://gofrp.org](https://gofrp.org/docs)。
|
||||||
@ -67,7 +82,7 @@ frp 是一个免费且开源的项目,我们欢迎任何人为其开发和进
|
|||||||
|
|
||||||
### 知识星球
|
### 知识星球
|
||||||
|
|
||||||
如果您想学习 frp 相关的知识和技术,或者寻求任何帮助及咨询,都可以通过微信扫描下方的二维码付费加入知识星球的官方社群:
|
如果您想了解更多 frp 相关技术以及更新详解,或者寻求任何帮助及咨询,都可以通过微信扫描下方的二维码付费加入知识星球的官方社群:
|
||||||
|
|
||||||
![zsxq](/doc/pic/zsxq.jpg)
|
![zsxq](/doc/pic/zsxq.jpg)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user