|
|
@ -14,23 +14,23 @@ func TestSocksTcpConnect(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
assert := unit.Assert(t)
|
|
|
|
assert := unit.Assert(t)
|
|
|
|
|
|
|
|
|
|
|
|
port := 12384
|
|
|
|
port := uint16(12384)
|
|
|
|
|
|
|
|
|
|
|
|
uuid := "2418d087-648d-4990-86e8-19dca1d006d3"
|
|
|
|
uuid := "2418d087-648d-4990-86e8-19dca1d006d3"
|
|
|
|
vid, err := core.UUIDToVID(uuid)
|
|
|
|
vid, err := core.UUIDToVID(uuid)
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
|
|
|
|
|
|
|
|
config := VConfig{
|
|
|
|
config := core.VConfig{
|
|
|
|
port,
|
|
|
|
port,
|
|
|
|
[]core.VUser{VUser{vid}},
|
|
|
|
[]core.VUser{core.VUser{vid}},
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
[]core.VNext{}}
|
|
|
|
[]core.VNext{}}
|
|
|
|
|
|
|
|
|
|
|
|
och := new(FakeOutboundConnectionHandler)
|
|
|
|
och := new(mocks.FakeOutboundConnectionHandler)
|
|
|
|
och.Data2Send = bytes.NewBuffer(make([]byte, 1024))
|
|
|
|
och.Data2Send = bytes.NewBuffer(make([]byte, 1024))
|
|
|
|
och.Data2Return = []byte("The data to be returned to socks server.")
|
|
|
|
och.Data2Return = []byte("The data to be returned to socks server.")
|
|
|
|
|
|
|
|
|
|
|
|
vpoint, err := NewVPoint(&config, SocksServerFactory{}, och)
|
|
|
|
vpoint, err := core.NewVPoint(&config, SocksServerFactory{}, och)
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
|
|
|
|
|
|
|
|
err = vpoint.Start()
|
|
|
|
err = vpoint.Start()
|
|
|
|