tcp_test.go 402 B

12345678910111213141516171819202122232425
  1. package proxy
  2. import (
  3. "sync"
  4. "testing"
  5. )
  6. func TestProxy(t *testing.T) {
  7. var wait sync.WaitGroup
  8. wait.Add(1)
  9. run := Run("test", TCPArgs{
  10. Local: ":8100",
  11. Parent: "10.0.1.174:5555",
  12. Timeout: 1500,
  13. PoolSize: 5,
  14. CheckParentInterval: 30,
  15. OutCallback: func() bool {
  16. return true
  17. },
  18. })
  19. if run == nil {
  20. wait.Done()
  21. }
  22. wait.Wait()
  23. }