Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Jan 20, 2020
1 parent 784f92b commit edcd221
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions V2rayU/v2ray/V2rayConfig.swift
Expand Up @@ -166,11 +166,14 @@ class V2rayConfig: NSObject {
inHttp.port = self.httpPort
inHttp.listen = self.httpHost
inHttp.protocol = V2rayProtocolInbound.http
inHttp.sniffing = V2rayInboundSniffing()

var inSocks = V2rayInbound()
inSocks.port = self.socksPort
inSocks.listen = self.socksHost
inSocks.protocol = V2rayProtocolInbound.socks
inSocks.settingSocks.udp = self.enableUdp
inSocks.sniffing = V2rayInboundSniffing()

if self.httpPort == self.socksPort {
self.httpPort = String((Int(self.socksPort) ?? 0) + 1)
Expand All @@ -181,6 +184,7 @@ class V2rayConfig: NSObject {
if (!self.isEmptyInput && self.v2ray.inbounds != nil && self.v2ray.inbounds!.count > 0) {
var inbounds: [V2rayInbound] = []
for var (_, item) in self.v2ray.inbounds!.enumerated() {
item.sniffing = V2rayInboundSniffing()
if item.protocol == V2rayProtocolInbound.http {
item.port = self.httpPort.count > 0 ? self.httpPort : "1087"
item.listen = self.httpHost.count > 0 ? self.httpHost : "127.0.0.1"
Expand Down Expand Up @@ -224,6 +228,8 @@ class V2rayConfig: NSObject {
var inboundDetour: [V2rayInbound] = []

for var (_, item) in self.v2ray.inboundDetour!.enumerated() {
item.sniffing = V2rayInboundSniffing()

if item.protocol == V2rayProtocolInbound.http {
item.port = self.httpPort
item.listen = self.httpHost
Expand Down
2 changes: 1 addition & 1 deletion V2rayU/v2ray/v2rayInbound.swift
Expand Up @@ -126,7 +126,7 @@ struct V2rayInboundSniffing: Codable {
case http
}

var enabled: Bool = false
var enabled: Bool = true
var destOverride: [dest] = [.tls, .http]
}

Expand Down
2 changes: 1 addition & 1 deletion V2rayU/v2ray/v2rayStruct.swift
Expand Up @@ -73,7 +73,7 @@ struct V2rayRoutingSetting: Codable {
case IPOnDemand
}

var domainStrategy: domainStrategy = .IPIfNonMatch
var domainStrategy: domainStrategy = .AsIs
var rules: [V2rayRoutingSettingRule] = [V2rayRoutingSettingRule()]
}

Expand Down

0 comments on commit edcd221

Please sign in to comment.