MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / trojanLink

Function trojanLink

internal/subscription/vless.go:285–298  ·  view source on GitHub ↗
(ib inbounds.Inbound, host inbounds.Host, acc users.UserInbound, username, addr string, port int)

Source from the content-addressed store, hash-verified

283}
284
285func 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>
301func anytlsLink(ib inbounds.Inbound, host inbounds.Host, acc users.UserInbound, username, addr string, port int) string {

Callers 2

BuildLinksFunction · 0.85
LinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected