p4gefau1t / trojan-go

Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
GNU General Public License v3.0
7.8k stars 1.68k forks source link

Suggestions for improving trojan:// url format #76

Open phlinhng opened 4 years ago

phlinhng commented 4 years ago

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

DuckSoft commented 4 years ago

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.

phlinhng commented 4 years ago

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 commented 4 years ago

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.

h31105 commented 4 years ago

发一个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]

phlinhng commented 4 years ago

发一个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.

h31105 commented 4 years ago

发一个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 小火箭可以识别

ghost commented 4 years ago

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

ghost commented 4 years ago

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