diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go index 78d669e44..147a3fc32 100644 --- a/proxy/blackhole/config.go +++ b/proxy/blackhole/config.go @@ -1,9 +1,6 @@ package blackhole import ( - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/any" - "v2ray.com/core/common/buf" "v2ray.com/core/common/serial" ) @@ -19,28 +16,17 @@ Content-Length: 0 ) type ResponseConfig interface { - AsAny() *any.Any WriteTo(buf.Writer) } func (v *NoneResponse) WriteTo(buf.Writer) {} -func (v *NoneResponse) AsAny() *any.Any { - r, _ := ptypes.MarshalAny(v) - return r -} - func (v *HTTPResponse) WriteTo(writer buf.Writer) { b := buf.NewLocal(512) b.AppendSupplier(serial.WriteString(http403response)) writer.Write(b) } -func (v *HTTPResponse) AsAny() *any.Any { - r, _ := ptypes.MarshalAny(v) - return r -} - func (v *Config) GetInternalResponse() (ResponseConfig, error) { if v.GetResponse() == nil { return new(NoneResponse), nil diff --git a/proxy/socks/config.go b/proxy/socks/config.go index cd0132201..caaddad07 100644 --- a/proxy/socks/config.go +++ b/proxy/socks/config.go @@ -3,9 +3,6 @@ package socks import ( v2net "v2ray.com/core/common/net" "v2ray.com/core/common/protocol" - - "github.com/golang/protobuf/ptypes" - google_protobuf "github.com/golang/protobuf/ptypes/any" ) func (v *Account) Equals(another protocol.Account) bool { @@ -23,10 +20,6 @@ func NewAccount() protocol.AsAccount { return &Account{} } -func (v *Account) AsAny() (*google_protobuf.Any, error) { - return ptypes.MarshalAny(v) -} - func (v *ServerConfig) HasAccount(username, password string) bool { if v.Accounts == nil { return false