Files
2026-03-05 14:09:24 +08:00

60 lines
1.3 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
--- /dev/null
+++ b/docs/configuration/inbound/mysql.zh.md
@@ -0,0 +1,56 @@
+// OMV
+
+### 结构
+
+```json
+{
+ "type": "mysql",
+ "tag": "mysql-in",
+
+ ... // 监听字段
+
+ "users": [
+ {
+ "user": "root",
+ "password": "my_password"
+ }
+ ],
+ "tls": {},
+ "multiplex": {}
+}
+```
+
+### 监听字段
+
+详见 [监听字段](/configuration/shared/listen/)。
+
+### 字段
+
+#### users
+
+MySQL 用户列表,用于握手阶段的身份验证。
+
+#### tls
+
+==必填==
+
+TLS 配置,详见 [TLS](/configuration/shared/tls/#inbound)。
+
+由于 MySQL 协议在握手阶段进行 TLS 协商,TLS 必须启用。
+
+#### multiplex
+
+详见 [多路复用](/configuration/shared/multiplex#inbound)。
+
+### 说明
+
+MySQL 入站通过 MySQL 协议握手完成 TLS 协商,随后在加密连接上运行 smux 多路复用。
+
+连接流程:
+
+1. 客户端连接并执行标准 MySQL 握手(使用 [go-mysql](https://github.com/go-mysql-org/go-mysql)
+2. TLS 在 MySQL 握手过程中完成协商
+3. 握手结束后,smux 会话在 TLS 连接之上进行多路复用
+4. 每个 smux 流携带 1 字节命令(`0x01` 表示 TCP`0x03` 表示 UDP)加 SOCKS 地址头
+
+在网络观察者眼中,该流量表现为正常的 MySQL TLS 会话。