config_json_test.go 467 B

123456789101112131415161718192021
  1. // +build json
  2. package socks_test
  3. import (
  4. "testing"
  5. "github.com/v2ray/v2ray-core/proxy/internal"
  6. "github.com/v2ray/v2ray-core/proxy/socks"
  7. "github.com/v2ray/v2ray-core/testing/assert"
  8. )
  9. func TestDefaultIPAddress(t *testing.T) {
  10. assert := assert.On(t)
  11. socksConfig, err := internal.CreateInboundConfig("socks", []byte(`{
  12. "auth": "noauth"
  13. }`))
  14. assert.Error(err).IsNil()
  15. assert.Address(socksConfig.(*socks.Config).Address).EqualsString("127.0.0.1")
  16. }