v2ray-core/proxy/socks/config_json_test.go

22 lines
467 B
Go
Raw Normal View History

// +build json
package socks_test
import (
"testing"
2016-06-10 20:26:39 +00:00
"github.com/v2ray/v2ray-core/proxy/internal"
"github.com/v2ray/v2ray-core/proxy/socks"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestDefaultIPAddress(t *testing.T) {
2016-05-24 19:55:46 +00:00
assert := assert.On(t)
2016-06-10 20:26:39 +00:00
socksConfig, err := internal.CreateInboundConfig("socks", []byte(`{
"auth": "noauth"
}`))
assert.Error(err).IsNil()
2016-05-24 19:55:46 +00:00
assert.Address(socksConfig.(*socks.Config).Address).EqualsString("127.0.0.1")
}