mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-30 23:37:44 +00:00
introduce address family in v2net
This commit is contained in:
15 files changed
+73
-78
No files matched your search
@@ -81,7 +81,7 @@ func (this *InboundConnectionConfig) UnmarshalJSON(data []byte) error {
|
||||
this.Port = v2net.Port(jsonConfig.Port)
|
||||
this.ListenOn = v2net.AnyIP
|
||||
if jsonConfig.Listen != nil {
|
||||
if jsonConfig.Listen.Address.IsDomain() {
|
||||
if jsonConfig.Listen.Address.Family().IsDomain() {
|
||||
return errors.New("Point: Unable to listen on domain address: " + jsonConfig.Listen.Address.Domain())
|
||||
}
|
||||
this.ListenOn = jsonConfig.Listen.Address
|
||||
@@ -112,7 +112,7 @@ func (this *OutboundConnectionConfig) UnmarshalJSON(data []byte) error {
|
||||
|
||||
if jsonConfig.SendThrough != nil {
|
||||
address := jsonConfig.SendThrough.Address
|
||||
if address.IsDomain() {
|
||||
if address.Family().IsDomain() {
|
||||
return errors.New("Point: Unable to send through: " + address.String())
|
||||
}
|
||||
this.SendThrough = address
|
||||
@@ -200,7 +200,7 @@ func (this *InboundDetourConfig) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
this.ListenOn = v2net.AnyIP
|
||||
if jsonConfig.ListenOn != nil {
|
||||
if jsonConfig.ListenOn.Address.IsDomain() {
|
||||
if jsonConfig.ListenOn.Address.Family().IsDomain() {
|
||||
return errors.New("Point: Unable to listen on domain address: " + jsonConfig.ListenOn.Address.Domain())
|
||||
}
|
||||
this.ListenOn = jsonConfig.ListenOn.Address
|
||||
@@ -241,7 +241,7 @@ func (this *OutboundDetourConfig) UnmarshalJSON(data []byte) error {
|
||||
|
||||
if jsonConfig.SendThrough != nil {
|
||||
address := jsonConfig.SendThrough.Address
|
||||
if address.IsDomain() {
|
||||
if address.Family().IsDomain() {
|
||||
return errors.New("Point: Unable to send through: " + address.String())
|
||||
}
|
||||
this.SendThrough = address
|
||||
|
||||
Reference in new issue
Block a user