Documentation
¶
Overview ¶
Package xrayconf builds xray-core JSON configs from saved server profiles. It's shared by the desktop app and the Android app (github.com/freeb5d/kite-android), so both speak every link shape the same way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build returns an xray-core JSON config for server. The proxy outbound is tagged "proxy" and its traffic counters are registered as "outbound>>>proxy>>>traffic>>>uplink"/"downlink" in xray's stats.Manager.
func FirstNonEmpty ¶
FirstNonEmpty returns the first non-empty value.
Types ¶
type Options ¶
type Options struct {
HTTPPort int // local HTTP proxy port; 0 = no HTTP inbound
SOCKSPort int // local SOCKS5 proxy port; 0 = no SOCKS inbound
TUN bool // add xray's TUN inbound
TUNName string // TUN adapter name (desktop); ignored on Android
LogPath string // xray error/debug log file; empty = stderr
LogLevel string // xray loglevel; default "debug"
// SSHBridgePort is the local SOCKS port of a running sshbridge.Bridge;
// required for "ssh" servers, which xray-core can't speak itself.
SSHBridgePort int
// DirectPrivate sends private/local network addresses (LAN, the
// carrier's internal DNS, ...) out directly instead of via the server.
// Only safe where xray's own sockets bypass the TUN (Android).
DirectPrivate bool
}
Options selects what the generated config listens on.
Click to show internal directories.
Click to hide internal directories.