core.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. "fmt"
  14. "runtime"
  15. "github.com/xtls/xray-core/common/serial"
  16. )
  17. var (
  18. Version_x byte = 1
  19. Version_y byte = 8
  20. Version_z byte = 1
  21. )
  22. var (
  23. build = "Custom"
  24. codename = "Xray, Penetrates Everything."
  25. intro = "A unified platform for anti-censorship."
  26. )
  27. // Version returns Xray's version as a string, in the form of "x.y.z" where x, y and z are numbers.
  28. // ".z" part may be omitted in regular releases.
  29. func Version() string {
  30. return fmt.Sprintf("%v.%v.%v", Version_x, Version_y, Version_z)
  31. }
  32. // VersionStatement returns a list of strings representing the full version info.
  33. func VersionStatement() []string {
  34. return []string{
  35. serial.Concat("Xray ", Version(), " (", codename, ") ", build, " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")"),
  36. intro,
  37. }
  38. }