tcp_test.go 418 B

1234567891011121314151617181920212223242526
  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. Regist("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. err := Run("test")
  20. if err != nil {
  21. wait.Done()
  22. }
  23. wait.Wait()
  24. }