From 8bd5573c939589dbddc4e874651e199097cff9fe Mon Sep 17 00:00:00 2001 From: Toby Date: Wed, 22 Dec 2021 21:41:27 -0800 Subject: [PATCH] docs: URI Scheme --- README.md | 22 +++++++++++++++++++++- README.zh.md | 21 ++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d73ecf..8ecac6e 100644 --- a/README.md +++ b/README.md @@ -383,6 +383,26 @@ ACL is available on both client & server. On the server side it can be used to r is valid for any mode on the client side. On the client side, it's only supported in SOCKS5 & HTTP proxy modes, and has no effect in other modes (all traffic will go through the proxy) +## URI Scheme + +Third party clients looking to implement a "share by link" feature are advised to follow the following URI scheme +(initially introduced by Shadowrocket): + + hysteria://host:port?protocol=udp&auth=123456&peer=sni.domain&insecure=1&upmbps=100&downmbps=100&alpn=hysteria&obfs=xplus&obfsParam=123456#remarks + + - host: hostname or IP address of the server to connect to (required) + - port: port of the server to connect to (required) + - protocol: protocol to use ("udp" or "faketcp") (optional, default: "udp") + - auth: authentication payload (string) (optional) + - peer: SNI for TLS (optional) + - insecure: ignore certificate errors (optional) + - upmbps: upstream bandwidth in Mbps (required) + - downmbps: downstream bandwidth in Mbps (required) + - alpn: QUIC ALPN (optional) + - obfs: Obfuscation mode (optional, empty or "xplus") + - obfsParam: Obfuscation password (optional) + - remarks: remarks (optional) + ## Logging The program outputs `DEBUG` level, text format logs via stdout by default. @@ -394,7 +414,7 @@ To print JSON instead, set `LOGGING_FORMATTER` to `json` To change the logging timestamp format, set `LOGGING_TIMESTAMP_FORMAT` - ## Hysteria custom CA +## Custom CA 1. Suppose the server address is `123.123.123.123`, UDP port `5678` is not blocked by firewall 2. openssl is already installed diff --git a/README.zh.md b/README.zh.md index b83844a..a71ac55 100644 --- a/README.zh.md +++ b/README.zh.md @@ -362,6 +362,25 @@ Hysteria 服务端与客户端默认的 receive window 大小是 64 MB。如果 ACL 在服务端和客户端都可以使用。在服务端可以用来实现限制客户端能访问的目标,对客户端任何模式都有效。在客户端只有 SOCKS5 和 HTTP 代理 支持 ACL。其他模式下没有效果(所有流量都会走代理)。 +## URI Scheme + +希望包含链接分享/导入功能的第三方客户端,建议按照如下 URI Scheme 实现(最初由 Shadowrocket 引入): + + hysteria://host:port?protocol=udp&auth=123456&peer=sni.domain&insecure=1&upmbps=100&downmbps=100&alpn=hysteria&obfs=xplus&obfsParam=123456#remarks + + - host: hostname or IP address of the server to connect to (required) + - port: port of the server to connect to (required) + - protocol: protocol to use ("udp" or "faketcp") (optional, default: "udp") + - auth: authentication payload (string) (optional) + - peer: SNI for TLS (optional) + - insecure: ignore certificate errors (optional) + - upmbps: upstream bandwidth in Mbps (required) + - downmbps: downstream bandwidth in Mbps (required) + - alpn: QUIC ALPN (optional) + - obfs: Obfuscation mode (optional, empty or "xplus") + - obfsParam: Obfuscation password (optional) + - remarks: remarks (optional) + ## 日志 程序默认在 stdout 输出 DEBUG 级别,文字格式的日志。 @@ -373,7 +392,7 @@ ACL 在服务端和客户端都可以使用。在服务端可以用来实现限 如果需要修改日志时间戳格式可以使用 `LOGGING_TIMESTAMP_FORMAT` - ## Hysteria自定义CA方法 + ## 自定义 CA 方法 1. 假设服务器地址是 `123.123.123.123`, 端口`5678`UDP/TCP协议未被防火墙拦截 2. 已经安装了 openssl