socks_test.go 779 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package socks
  2. import (
  3. "bytes"
  4. "testing"
  5. "github.com/v2ray/v2ray-core"
  6. "github.com/v2ray/v2ray-core/testing/mocks"
  7. "github.com/v2ray/v2ray-core/testing/unit"
  8. )
  9. func TestSocksTcpConnect(t *testing.T) {
  10. t.Skip("Not ready yet.")
  11. assert := unit.Assert(t)
  12. port := 12384
  13. uuid := "2418d087-648d-4990-86e8-19dca1d006d3"
  14. vid, err := core.UUIDToVID(uuid)
  15. assert.Error(err).IsNil()
  16. config := VConfig{
  17. port,
  18. []core.VUser{VUser{vid}},
  19. "",
  20. []core.VNext{}}
  21. och := new(FakeOutboundConnectionHandler)
  22. och.Data2Send = bytes.NewBuffer(make([]byte, 1024))
  23. och.Data2Return = []byte("The data to be returned to socks server.")
  24. vpoint, err := NewVPoint(&config, SocksServerFactory{}, och)
  25. assert.Error(err).IsNil()
  26. err = vpoint.Start()
  27. assert.Error(err).IsNil()
  28. }