diff --git a/config.go b/config.go index 16b622e5..a3d543ff 100644 --- a/config.go +++ b/config.go @@ -46,3 +46,10 @@ func (this *OutboundConnectionConfig) GetTypedSettings() (interface{}, error) { } return this.GetSettings().GetInstance() } + +func (this *OutboundConnectionConfig) GetSendThroughValue() v2net.Address { + if this.GetSendThrough() == nil { + return v2net.AnyIP + } + return this.SendThrough.AsAddress() +} diff --git a/v2ray.go b/v2ray.go index fe8f01f9..eb15977e 100644 --- a/v2ray.go +++ b/v2ray.go @@ -111,7 +111,7 @@ func NewPoint(pConfig *Config) (*Point, error) { outboundHandler, err := proxyregistry.CreateOutboundHandler( outbound.Settings.Type, vpoint.space, outboundSettings, &proxy.OutboundHandlerMeta{ Tag: outbound.Tag, - Address: outbound.SendThrough.AsAddress(), + Address: outbound.GetSendThroughValue(), StreamSettings: outbound.StreamSettings, }) if err != nil {