2016-01-15 06:43:06 -05:00
|
|
|
// +build json
|
|
|
|
|
|
|
|
package socks_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-08-20 14:55:45 -04:00
|
|
|
"v2ray.com/core/proxy/registry"
|
2016-08-29 06:23:17 -04:00
|
|
|
. "v2ray.com/core/proxy/socks"
|
2016-08-20 14:55:45 -04:00
|
|
|
"v2ray.com/core/testing/assert"
|
2016-01-15 06:43:06 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestDefaultIPAddress(t *testing.T) {
|
2016-05-24 15:55:46 -04:00
|
|
|
assert := assert.On(t)
|
2016-01-15 06:43:06 -05:00
|
|
|
|
2016-08-17 17:30:15 -04:00
|
|
|
socksConfig, err := registry.CreateInboundConfig("socks", []byte(`{
|
2016-01-15 06:43:06 -05:00
|
|
|
"auth": "noauth"
|
|
|
|
}`))
|
|
|
|
assert.Error(err).IsNil()
|
2016-08-29 06:25:16 -04:00
|
|
|
assert.Address(socksConfig.(*ServerConfig).GetNetAddress()).EqualsString("127.0.0.1")
|
2016-01-15 06:43:06 -05:00
|
|
|
}
|