core.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. //go:generate go run github.com/xtls/xray-core/common/errors/errorgen
  12. import (
  13. "runtime"
  14. "github.com/xtls/xray-core/common/serial"
  15. )
  16. var (
  17. version = "1.4.1"
  18. build = "Custom"
  19. codename = "Xray, Penetrates Everything."
  20. intro = "A unified platform for anti-censorship."
  21. )
  22. // Version returns Xray's version as a string, in the form of "x.y.z" where x, y and z are numbers.
  23. // ".z" part may be omitted in regular releases.
  24. func Version() string {
  25. return version
  26. }
  27. // VersionStatement returns a list of strings representing the full version info.
  28. func VersionStatement() []string {
  29. return []string{
  30. serial.Concat("Xray ", Version(), " (", codename, ") ", build, " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")"),
  31. intro,
  32. }
  33. }