consts.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package consts
  2. import (
  3. "fmt"
  4. "time"
  5. "github.com/fatedier/frp/test/e2e/pkg/port"
  6. )
  7. const (
  8. TestString = "frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
  9. DefaultTimeout = 2 * time.Second
  10. )
  11. var (
  12. PortServerName string
  13. PortClientAdmin string
  14. DefaultServerConfig = `
  15. bindPort = {{ .%s }}
  16. log.level = "trace"
  17. `
  18. DefaultClientConfig = `
  19. serverAddr = "127.0.0.1"
  20. serverPort = {{ .%s }}
  21. loginFailExit = false
  22. log.level = "trace"
  23. `
  24. LegacyDefaultServerConfig = `
  25. [common]
  26. bind_port = {{ .%s }}
  27. log_level = trace
  28. `
  29. LegacyDefaultClientConfig = `
  30. [common]
  31. server_addr = 127.0.0.1
  32. server_port = {{ .%s }}
  33. login_fail_exit = false
  34. log_level = trace
  35. `
  36. )
  37. func init() {
  38. PortServerName = port.GenName("Server")
  39. PortClientAdmin = port.GenName("ClientAdmin")
  40. LegacyDefaultServerConfig = fmt.Sprintf(LegacyDefaultServerConfig, port.GenName("Server"))
  41. LegacyDefaultClientConfig = fmt.Sprintf(LegacyDefaultClientConfig, port.GenName("Server"))
  42. DefaultServerConfig = fmt.Sprintf(DefaultServerConfig, port.GenName("Server"))
  43. DefaultClientConfig = fmt.Sprintf(DefaultClientConfig, port.GenName("Server"))
  44. }