New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trojan-go:// 分享链接规范 #132
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
help wanted
Extra attention is needed
Comments
p4gefau1t
added
documentation
Improvements or additions to documentation
enhancement
New feature or request
help wanted
Extra attention is needed
labels
Jul 11, 2020
Update:写了一个 coverage 100% 的 parser:#133 |
@p4gefau1t 建议 pin 一下。 |
指纹伪造的参数是什么呢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
help wanted
Extra attention is needed
原则
概览
特别说明:
$()
代表此处需要encodeURIComponent
。举例
trojan-go://[email protected]/?sni=microsoft.com&type=ws&path=%2Fgo&encryption=ss%3Baes-256-gcm%3Afuckgfw
详述
注意:所有参数名和常数字符串均区分大小写。
trojan-password
Trojan 的密码。
不可省略,不能为空字符串,不建议含有非 ASCII 可打印字符。
必须使用
encodeURIComponent
编码。trojan-host
节点 IP / 域名。
不可省略,不能为空字符串。
IPv6 地址必须扩方括号。
IDN 域名(如“百度.cn”)必须使用
xn--xxxxxx
格式。port
节点端口。
省略时默认为
443
。必须取
[1,65535]
中的整数。tls
没有这个字段。
TLS 默认一直启用,除非有传输插件禁用它。
TLS 默认不允许不安全证书,所以不要想什么
allowInsecure
之类的,这种节点不适合分享给别人。sni
自定义 TLS 的 SNI。
省略时默认与
trojan-host
同值。不得为空字符串。必须使用
encodeURIComponent
编码。type
传输类型。
省略时默认为
original
,但不可为空字符串。目前可选值只有
original
和ws
,未来可能会有h2
、h2+ws
等取值。当取值为
original
时,使用原始 Trojan 传输方式,无法方便通过 CDN。当取值为
ws
时,使用 wss 作为传输层。host
自定义 HTTP
Host
头。可以省略,省略时值同
trojan-host
。可以为空字符串,但可能带来非预期情形。
警告:若你的端口非标准端口(不是 80 / 443),RFC 标准规定
Host
应在主机名后附上端口号,例如example.com:44333
。至于是否遵守,请自行斟酌。必须使用
encodeURIComponent
编码。path
当传输类型
type
取ws
、h2
、h2+ws
时,此项有效。不可省略,不可为空。
必须以
/
开头。可以使用 URL 中的
&
#
?
等字符,但应当是合法的 URL 路径。必须使用
encodeURIComponent
编码。mux
没有这个字段。
当前服务器默认一直支持
mux
。启用
mux
与否各有利弊,应由客户端决定自己是否启用。encryption
用于保证 Trojan 流量密码学安全的加密层。
可省略,默认为
none
,即不使用加密。不可以为空字符串。
必须使用 encodeURIComponent 编码。
使用 Shadowsocks 算法进行流量加密时,其格式为:
其中 ss 是固定内容,method 是加密方法,必须为下列之一:
aes-128-gcm
aes-256-gcm
chacha20-ietf-poly1305
其中的
password
是 Shadowsocks 的密码,不得为空字符串。password
中若包含分号或冒号,不需要进行转义。password
应为英文可打印 ASCII 字符。其他加密方案待定。
plugin
额外的插件选项。本字段保留。
可省略,但不可以为空字符串。
URL Fragment (# 后内容)
节点说明。
不建议省略,不建议为空字符串。
必须使用
encodeURIComponent
编码。The text was updated successfully, but these errors were encountered: