config_json_test.go 512 B

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