2016-01-15 06:43:06 -05:00
|
|
|
// +build json
|
|
|
|
|
|
|
|
package socks_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-06-10 16:26:39 -04:00
|
|
|
"github.com/v2ray/v2ray-core/proxy/internal"
|
2016-01-15 06:43:06 -05:00
|
|
|
"github.com/v2ray/v2ray-core/proxy/socks"
|
|
|
|
"github.com/v2ray/v2ray-core/testing/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
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-06-10 16:26:39 -04:00
|
|
|
socksConfig, err := internal.CreateInboundConfig("socks", []byte(`{
|
2016-01-15 06:43:06 -05:00
|
|
|
"auth": "noauth"
|
|
|
|
}`))
|
|
|
|
assert.Error(err).IsNil()
|
2016-05-24 15:55:46 -04:00
|
|
|
assert.Address(socksConfig.(*socks.Config).Address).EqualsString("127.0.0.1")
|
2016-01-15 06:43:06 -05:00
|
|
|
}
|