trojan-go icon indicating copy to clipboard operation
trojan-go copied to clipboard

Suggestions for improving trojan:// url format

Open phlinhng opened this issue 4 years ago • 8 comments

For now, trojan-go use trojan-gfw compatible trojan:// uri to pass client-side configuration. I would like to suggest that trojan-go design an extension format to support trojan-go specific features. Here is my rough draft.

Current format

trojan://[password]@[host]:[port]?peer=[server_name]#[remark (url encoded)]

Draft

  1. keep the trojan:// uri scheme
  2. stay ~~#peer=~~ # at the end of the url
  3. pass trojan-go specific arguments after "?" (just like http url)
  4. separate arguments with "&"
trojan://[password]@[host]:[port]?wss=[bool]&mux=[bool]&peer=[server_name]#[remark (url encoded)]

Reference

https://github.com/trojan-gfw/trojan-url

phlinhng avatar Jun 03 '20 15:06 phlinhng

I personally suggest that we use a different scheme name in some cases, for example, trojan-go, since trojan-go ws is not compatible with trojan-gfw clients.

DuckSoft avatar Jun 06 '20 16:06 DuckSoft

I personally suggest that we use a different scheme name in some cases, for example, trojan-go, since trojan-go ws is not compatible with trojan-gfw clients.

Since trojan-go can still work as trojan-gfw compatible mode, I won't suggest that trojan-go should use a different uri scheme.

phlinhng avatar Jun 07 '20 11:06 phlinhng

I just realised that peer stand for an argument as "tls server name". I've made a stupid mistake. It's fixed in the original topic now.

phlinhng avatar Jul 10 '20 11:07 phlinhng

发一个qt5现在版本用的格式,openwrt ssr plus、shadowrocket 也能用(小火箭能正确识别mux=1 trojan://[password]@[serverdomain]:[port]?allowinsecure=0&tfo=0&sni=&mux=1&ws=0&wss=0&wsPath=&wsHostname=&wsObfsPassword=&group=#[groupname]

h31105 avatar Jul 10 '20 12:07 h31105

发一个qt5现在版本用的格式,openwrt ssr plus、shadowrocket 也能用(小火箭能正确识别mux=1 trojan://[password]@[serverdomain]:[port]?allowinsecure=0&tfo=0&sni=&mux=1&ws=0&wss=0&wsPath=&wsHostname=&wsObfsPassword=&group=#[groupname]

can sni be identified in Shadowrocket ? since shadowrocket use self-defined keyword peer to represent sni, it will be better if the standard change or Shadowrocket add support for sni keyword.

phlinhng avatar Jul 10 '20 12:07 phlinhng

发一个qt5现在版本用的格式,openwrt ssr plus、shadowrocket 也能用(小火箭能正确识别mux=1 trojan://[password]@[serverdomain]:[port]?allowinsecure=0&tfo=0&sni=&mux=1&ws=0&wss=0&wsPath=&wsHostname=&wsObfsPassword=&group=#[groupname]

can sni be identified in Shadowrocket ? since shadowrocket use self-defined keyword peer to represent sni, it will be better if the standard change or Shadowrocket add support for sni keyword.

实测目前 openwrt ssr plus、shadowrocket 都不认sni, 至于其他的参数,也只有mux 小火箭可以识别

h31105 avatar Jul 10 '20 12:07 h31105

@h31105 Better let shadowrocket support sni instead of me change my software standard

ghost avatar Jul 10 '20 12:07 ghost

sni stands for Server Name Indication, which itself is a standardized rule indicating a domain name when using SSL. While peer is not, could it be a bittorrent peer?

Qv2ray will use SNI or sni instead of peer

ghost avatar Jul 10 '20 12:07 ghost