github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/core/core.go (about) 1 // Package core provides an entry point to use Xray core functionalities. 2 // 3 // Xray makes it possible to accept incoming network connections with certain 4 // protocol, process the data, and send them through another connection with 5 // the same or a difference protocol on demand. 6 // 7 // It may be configured to work with multiple protocols at the same time, and 8 // uses the internal router to tunnel through different inbound and outbound 9 // connections. 10 package core 11 12 //go:generate go run github.com/xtls/xray-core/common/errors/errorgen 13 14 import ( 15 "fmt" 16 "runtime" 17 18 "github.com/xtls/xray-core/common/serial" 19 ) 20 21 var ( 22 Version_x byte = 1 23 Version_y byte = 8 24 Version_z byte = 11 25 ) 26 27 var ( 28 build = "Custom" 29 codename = "Xray, Penetrates Everything." 30 intro = "A unified platform for anti-censorship." 31 ) 32 33 // Version returns Xray's version as a string, in the form of "x.y.z" where x, y and z are numbers. 34 // ".z" part may be omitted in regular releases. 35 func Version() string { 36 return fmt.Sprintf("%v.%v.%v", Version_x, Version_y, Version_z) 37 } 38 39 // VersionStatement returns a list of strings representing the full version info. 40 func VersionStatement() []string { 41 return []string{ 42 serial.Concat("Xray ", Version(), " (", codename, ") ", build, " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")"), 43 intro, 44 } 45 }