(ib inbounds.Inbound, host inbounds.Host, acc users.UserInbound, username, addr string, port int)
| 283 | } |
| 284 | |
| 285 | func trojanLink(ib inbounds.Inbound, host inbounds.Host, acc users.UserInbound, username, addr string, port int) string { |
| 286 | query := url.Values{} |
| 287 | query.Set("type", "ws") |
| 288 | query.Set("path", "/ws") |
| 289 | query.Set("security", "tls") |
| 290 | query.Set("sni", addr) |
| 291 | if host.Fingerprint != "" { |
| 292 | query.Set("fp", host.Fingerprint) |
| 293 | } |
| 294 | |
| 295 | return fmt.Sprintf("trojan://%s@%s:%d?%s#%s", |
| 296 | acc.Secret, addr, port, query.Encode(), url.PathEscape(username), |
| 297 | ) |
| 298 | } |
| 299 | |
| 300 | // anytlsLink 生成 AnyTLS 订阅链接:anytls://<password>@<host>:<port>?sni=<sni>#<name> |
| 301 | func anytlsLink(ib inbounds.Inbound, host inbounds.Host, acc users.UserInbound, username, addr string, port int) string { |
no outgoing calls
no test coverage detected