option to allow passive connection

This commit is contained in:
v2ray committed 2016-08-12 23:37:21 +02:00
1 parent a43ee2f1c2
commit bcd27ba36f
18 files changed
+76 -47

No files matched your search

+4
View File
@@ -71,6 +71,7 @@ func (this *InboundConnectionConfig) UnmarshalJSON(data []byte) error {
Protocol string `json:"protocol"`
StreamSetting *internet.StreamSettings `json:"streamSettings"`
Settings json.RawMessage `json:"settings"`
AllowPassive bool `json:"allowPassive"`
}
jsonConfig := new(JsonConfig)
@@ -91,6 +92,7 @@ func (this *InboundConnectionConfig) UnmarshalJSON(data []byte) error {
this.Protocol = jsonConfig.Protocol
this.Settings = jsonConfig.Settings
this.AllowPassiveConnection = jsonConfig.AllowPassive
return nil
}
@@ -186,6 +188,7 @@ func (this *InboundDetourConfig) UnmarshalJSON(data []byte) error {
Tag string `json:"tag"`
Allocation *InboundDetourAllocationConfig `json:"allocate"`
StreamSetting *internet.StreamSettings `json:"streamSettings"`
AllowPassive bool `json:"allowPassive"`
}
jsonConfig := new(JsonInboundDetourConfig)
if err := json.Unmarshal(data, jsonConfig); err != nil {
@@ -216,6 +219,7 @@ func (this *InboundDetourConfig) UnmarshalJSON(data []byte) error {
if jsonConfig.StreamSetting != nil {
this.StreamSettings = jsonConfig.StreamSetting
}
this.AllowPassiveConnection = jsonConfig.AllowPassive
return nil
}