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