-
Notifications
You must be signed in to change notification settings - Fork 97
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
Showing
11 changed files
with
73 additions
and
16 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "转发 DNS 查询请求" | ||
weight: 4 | ||
weight: 20 | ||
description: > | ||
这个示例通过简单配置 UDP 类型的代理转发 DNS 查询请求。 | ||
--- | ||
|
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
52 changes: 52 additions & 0 deletions
52
content/zh-cn/docs/Examples/multiple-ssh-over-same-port.md
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,52 @@ | ||
--- | ||
title: "多个 SSH 服务复用同一端口" | ||
weight: 10 | ||
description: > | ||
这个示例通过 tcpmux 类型的代理,实现多个 ssh 服务通过同一个端口暴露。与此类似,只要是能够支持 HTTP Connect 代理连接方式的客户端,都可以通过这种方式来实现对端口的复用。 | ||
--- | ||
|
||
1. 在具有公网 IP 的机器上部署 frps,修改 frps.ini 文件,这里使用了最简化的配置: | ||
|
||
```ini | ||
[common] | ||
bind_port = 7000 | ||
tcpmux_httpconnect_port = 5002 | ||
``` | ||
|
||
2. 在内网机器 A 上部署 frpc,配置文件: | ||
|
||
```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. 在内网机器 B 上部署另一个 frpc,配置文件: | ||
|
||
```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. 通过 SSH ProxyCommand 访问内网机器 A,假设用户名为 test: | ||
|
||
`ssh -o 'proxycommand socat - PROXY:x.x.x.x:machine-a.example.com:22,proxyport=5002' test@machine-a` | ||
|
||
访问内网机器 B,区别只在于域名不同,假设用户名为 test: | ||
|
||
`ssh -o 'proxycommand socat - PROXY:x.x.x.x:machine-b.example.com:22,proxyport=5002' test@machine-b` |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "通过 SSH 访问内网机器" | ||
weight: 2 | ||
weight: 5 | ||
description: > | ||
这个示例通过简单配置 TCP 类型的代理让用户访问到内网的服务器。 | ||
--- | ||
|
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "安全地暴露内网服务" | ||
weight: 8 | ||
weight: 40 | ||
description: > | ||
这个示例将会创建一个只有自己能访问到的 SSH 服务代理。 | ||
--- | ||
|
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "点对点内网穿透" | ||
weight: 9 | ||
weight: 45 | ||
description: > | ||
这个示例将会演示一种不通过服务器中转流量的方式来访问内网服务。 | ||
--- | ||
|
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