2016-01-15 06:43:06 -05:00
|
|
|
// +build json
|
|
|
|
|
|
|
|
package socks_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/v2ray/v2ray-core/proxy/internal/config"
|
|
|
|
"github.com/v2ray/v2ray-core/proxy/socks"
|
|
|
|
v2testing "github.com/v2ray/v2ray-core/testing"
|
|
|
|
"github.com/v2ray/v2ray-core/testing/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestDefaultIPAddress(t *testing.T) {
|
|
|
|
v2testing.Current(t)
|
|
|
|
|
2016-01-25 11:23:10 -05:00
|
|
|
socksConfig, err := config.CreateInboundConfig("socks", []byte(`{
|
2016-01-15 06:43:06 -05:00
|
|
|
"auth": "noauth"
|
|
|
|
}`))
|
|
|
|
assert.Error(err).IsNil()
|
|
|
|
assert.String(socksConfig.(*socks.Config).Address).Equals("127.0.0.1")
|
|
|
|
}
|