# 链接和参数示例

{% hint style="warning" %}
此信息**不是 VPN 配置指南**，也**不用于绕过封锁、访问违反您所在国家法律的禁止网站或应用程序**。
{% endhint %}

### 1. 概述

HAPP 应用程序支持多种旨在保障安全和绕过网络审查的现代协议：VLESS、VMess、Shadowsocks、Socks5、Trojan 以及 Hysteria2（包括 `hy2` 方案）。

***

### 2. 添加配置的方式

* 手动输入： 通过主屏幕上的 “+” 按钮进行添加。允许对协议的每个参数进行细粒度配置。
* URL/二维码导入： 自动识别剪贴板或通过摄像头扫描的方案链接（如 `vless://`、`vmess://` 等）。
* 订阅：
  * *标准订阅：* 指向文本格式服务器列表的 URL 链接。
  * *JSON 数组：* 包含预设密钥、路由规则和 Reality 参数的高级数据集。

***

### 3. JSON 配置文件的处理特性

当以 JSON 格式将服务器配置导入 HAPP 应用程序时，程序在与 XRAY 内核 交互时会采用特殊的处理机制。

#### 3.1 直接透传原则 (1:1)

启动 XRAY 内核时，此类 JSON 配置将以原始状态直接传递。

> 重要提示： 在此模式下，HAPP 的标准路由规则和界面设置不会应用到该 JSON 文件上。配置将完全按照其源代码逻辑运行。

#### 3.2 通过 HAPP 进行间接管理

尽管采用直接透传模式，应用程序仍可以通过路由方案控制内核的运行环境：

* GEO 文件管理： 您可以控制传递给内核执行的地理数据（Geo-data）文件。
* 优化（裁剪版 GEO 文件）： 启用此功能后，内核仅接收数据库的必要片段（带有选定标签的部分），从而节省系统资源。
* DNS 隧道： 远程 DNS 设置继承自应用程序当前的活动路由方案，用户可根据需要调整系统行为。

***

### 4. 高级参数 (URI Scheme)

#### 4.1 Hysteria 2 (`hy2://`)

| **参数**        | **说明**                          |
| ------------- | ------------------------------- |
| `auth`        | 认证数据（userpass 格式为 `用户名:密码`）。    |
| `port`        | 支持多端口：例如 `1234,5000-6000,7044`。 |
| `obfs`        | 混淆类型（例如 `salamander`）。          |
| `mportHopInt` | 端口跳跃间隔（秒）。                      |

#### 4.2 分片与噪声 (Fragmentation & Noises)

用于绕过深度包检测 (DPI) 的工具。仅当应用程序的全局设置关闭时，单个服务器的本地设置才会生效。

* 分片 (Fragmentation)： `fragment=length,interval,packets[,maxSplit]`
  * *示例：* `fragment=1-10,5-20,tlshello`
* 噪声 (Noises)：（必须配合分片使用）`noises=type,packet,delay[,applyTo]`
  * *示例：* `noises=rand,50-150,10-50,ip`

***

### 5. 可视化与元数据

为了方便管理服务器列表，可以在 URL 末尾的 `#` 符号后添加标签：

1. 标题 (`title`)： `#我的服务器`（最多 30 个字符）。
2. 服务器描述 (`serverDescription`)： 将技术性副标题（如 "VMess"）替换为自定义文本。
   * *格式：* `#标题?serverDescription=<base64编码文本>`
   * *JSON 格式：* 使用字段 `"meta": {"serverDescription": "您的文本"}`。

***

### 6. Socks5 代理示例

应用程序支持解析以下三种记录格式：

* 明文格式： `socks://user:pass@1.2.3.4:443`
* 部分 Base64： `socks://<base64编码的用户密码>@1.2.3.4:443#名称`
* 全 Base64： `socks://<完整字符串的base64编码>`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.happ.su/main/zh/dev-docs/examples-of-links-and-parameters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
