Skip to content

Commit

Permalink
fix: mention percent-encoding for auth in URI scheme, closes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed Oct 14, 2024
1 parent fc94b85 commit b1b249a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/docs/developers/URI-Scheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ hysteria2://[auth@]hostname[:port]/?[key=value]&[key=value]...

### Auth

The authentication credentials should be specified in the `auth` component of the URI. A special case is when the server uses the `userpass` authentication, in which case the `auth` component should be formatted as `username:password`.
Authentication credentials should be specified in the `auth` component of the URI. This is essentially the username part of the standard URI format, and therefore needs to be [percent-encoded](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1) if it contains special characters.

A special case is when the server uses the `userpass` authentication, in which case the `auth` component should be formatted as `username:password`.

### Hostname

Expand Down
4 changes: 3 additions & 1 deletion docs/docs/developers/URI-Scheme.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ hysteria2://[auth@]hostname[:port]/?[key=value]&[key=value]...

### 验证

验证密码应在 URI 的 `auth` 中指定。特殊情况是服务器使用 `userpass` 验证时,`auth` 应格式化为 `username:password`
验证密码应在 URI 的 `auth` 中指定。这部分实际上就是标准 URI 格式中的用户名部分,因此如果包含特殊字符,需要进行 [百分号编码](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1)

一种特殊情况是服务器使用 `userpass` 验证时,`auth` 应格式化为 `username:password`

### 地址

Expand Down

0 comments on commit b1b249a

Please sign in to comment.