2020-11-25 13:01:53 +02:00
|
|
|
// Package core provides an entry point to use Xray core functionalities.
|
|
|
|
//
|
|
|
|
// Xray makes it possible to accept incoming network connections with certain
|
|
|
|
// protocol, process the data, and send them through another connection with
|
|
|
|
// the same or a difference protocol on demand.
|
|
|
|
//
|
|
|
|
// It may be configured to work with multiple protocols at the same time, and
|
|
|
|
// uses the internal router to tunnel through different inbound and outbound
|
|
|
|
// connections.
|
|
|
|
package core
|
|
|
|
|
|
|
|
import (
|
2023-02-15 18:07:12 +02:00
|
|
|
"fmt"
|
2020-11-25 13:01:53 +02:00
|
|
|
"runtime"
|
|
|
|
|
2020-12-04 03:36:16 +02:00
|
|
|
"github.com/xtls/xray-core/common/serial"
|
2020-11-25 13:01:53 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2024-09-07 03:30:27 +03:00
|
|
|
Version_x byte = 24
|
|
|
|
Version_y byte = 9
|
2024-09-19 04:12:29 +03:00
|
|
|
Version_z byte = 19
|
2023-02-15 18:07:12 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2020-11-25 13:01:53 +02:00
|
|
|
build = "Custom"
|
|
|
|
codename = "Xray, Penetrates Everything."
|
|
|
|
intro = "A unified platform for anti-censorship."
|
|
|
|
)
|
|
|
|
|
|
|
|
// Version returns Xray's version as a string, in the form of "x.y.z" where x, y and z are numbers.
|
|
|
|
// ".z" part may be omitted in regular releases.
|
|
|
|
func Version() string {
|
2023-02-15 18:07:12 +02:00
|
|
|
return fmt.Sprintf("%v.%v.%v", Version_x, Version_y, Version_z)
|
2020-11-25 13:01:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// VersionStatement returns a list of strings representing the full version info.
|
|
|
|
func VersionStatement() []string {
|
|
|
|
return []string{
|
|
|
|
serial.Concat("Xray ", Version(), " (", codename, ") ", build, " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")"),
|
|
|
|
intro,
|
|
|
|
}
|
|
|
|
}
|