Documentation
¶
Overview ¶
Package link builds client share-links from a user + settings.
Index ¶
- func Custom(u model.User, in model.Inbound, set *model.Settings) string
- func CustomLabel(in model.Inbound, set *model.Settings) string
- func Hysteria2(u model.User, set *model.Settings) string
- func Label(proto string, set *model.Settings) string
- func Reality(u model.User, set *model.Settings) string
- func VLESS(u model.User, set *model.Settings) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Custom ¶ added in v1.5.0
Custom builds the share link for one operator-defined inbound, or "" for a protocol that has no link form. The three protocols each map to their own scheme and credential: VLESS carries the UUID, Trojan and Hysteria2 the password.
func CustomLabel ¶ added in v1.5.0
CustomLabel is the node name a custom inbound shows in the client: the operator's own name for it, prefixed with the server label on a multi-node install so two servers' inbounds never read as one.
func Hysteria2 ¶
Hysteria2 builds a hysteria2:// share link.
Format matches what x-ui/3x-ui and similar Xray-based panels emit and that clients such as v2rayNG / NekoBox (Xray core) accept:
hysteria2://<pw>@<host>:<port>?type=hysteria&security=tls&sni=<sni>
&alpn=h3&fm=<quicParams>#<label>
func Label ¶
Label is the node name appended after '#' in share links / used as the sing-box/Clash node tag. It's the admin-configured custom name for the protocol, or the default protocol label when unset (see Settings.ProtoLabel). The user name, when requested, goes into the subscription title instead (see sub.SubTitle).
func Reality ¶
Reality builds a vless:// share link for VLESS + XHTTP + REALITY.
vless://<uuid>@<host>:<port>?encryption=none&security=reality&type=xhttp
&path=<path>&mode=auto&pbk=<pub>&sid=<sid>&sni=<dest>&fp=<fp>#<label>
mode stays "auto" on purpose: with a REALITY config present Xray's client resolves auto to stream-one (one HTTP request per connection), which is both the smallest surface and what the server side expects. Pinning a different mode here would only make the two disagree.
Types ¶
This section is empty.