core.go 1.2 KB

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