Update On Sun Jul 21 20:29:04 CEST 2024

This commit is contained in:
github-action[bot]
2024-07-21 20:29:05 +02:00
parent e06319d65a
commit 67b34eb55e
121 changed files with 1783 additions and 790 deletions

Binary file not shown.

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<dict/>
<key>development</key>
<true/>
</dict>
</plist>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -142,7 +142,6 @@
669468492C076C2800146109 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
66973EB621797719001FEA1E /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
66A358672C39517F00914A25 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
66A358682C3959AE00914A25 /* build.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = build.plist; sourceTree = "<group>"; };
66A5CE4521706B5A009B08B2 /* Pods_V2rayU.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_V2rayU.framework; sourceTree = BUILT_PRODUCTS_DIR; };
66A77BE2268225790097A126 /* v2ray-core */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "v2ray-core"; path = "Build/v2ray-core"; sourceTree = "<group>"; };
66ACB19F21757D5B005B5881 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; };
@@ -297,7 +296,6 @@
66FEAD44217D75D7009DECF9 /* Build */ = {
isa = PBXGroup;
children = (
66A358682C3959AE00914A25 /* build.plist */,
6625848E2AB746D500DFDC1E /* appdmg.sh */,
66FEAD45217D75FC009DECF9 /* release.sh */,
6D6DFD93CE866018306A090E /* pac */,
@@ -432,7 +430,7 @@
};
buildConfigurationList = 664EB36C216C9A5E00B6AE0D /* Build configuration list for PBXProject "V2rayU" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = "zh-Hans";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -836,7 +834,7 @@
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.2.2;
CURRENT_PROJECT_VERSION = 4.2.3;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = "";
@@ -848,7 +846,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2.2;
MARKETING_VERSION = 4.2.3;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -874,7 +872,7 @@
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.2.2;
CURRENT_PROJECT_VERSION = 4.2.3;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = "";
@@ -886,7 +884,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 4.2.2;
MARKETING_VERSION = 4.2.3;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU;
PRODUCT_NAME = "$(TARGET_NAME)";

View File

@@ -300,45 +300,6 @@
</button>
</subviews>
</view>
<scrollView focusRingType="none" fixedFrame="YES" borderType="line" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="in5-Uo-f8c">
<rect key="frame" x="25" y="66" width="220" height="241"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" copiesOnScroll="NO" id="vCh-HN-u7f">
<rect key="frame" x="1" y="1" width="218" height="239"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" id="L49-ez-XJl">
<rect key="frame" x="0.0" y="0.0" width="218" height="239"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="remark" width="206" minWidth="40" maxWidth="1000" id="0WD-Qv-ia2">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" title="Text Cell" usesSingleLineMode="YES" id="YQ1-7i-YOl">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</tableColumn>
</tableColumns>
</tableView>
</subviews>
</clipView>
<edgeInsets key="contentInsets" left="0.0" right="0.0" top="0.0" bottom="0.0"/>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="dpI-Rq-Xuz">
<rect key="frame" x="1" y="224" width="218" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ys3-G3-wz7">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yay-tY-9RI">
<rect key="frame" x="25" y="55" width="220" height="23"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
@@ -374,6 +335,45 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<scrollView focusRingType="none" fixedFrame="YES" borderType="line" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="in5-Uo-f8c">
<rect key="frame" x="25" y="56" width="220" height="251"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" copiesOnScroll="NO" id="vCh-HN-u7f">
<rect key="frame" x="1" y="1" width="218" height="249"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" id="L49-ez-XJl">
<rect key="frame" x="0.0" y="0.0" width="218" height="249"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="remark" width="206" minWidth="40" maxWidth="1000" id="0WD-Qv-ia2">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" title="Text Cell" usesSingleLineMode="YES" id="YQ1-7i-YOl">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</tableColumn>
</tableColumns>
</tableView>
</subviews>
</clipView>
<edgeInsets key="contentInsets" left="0.0" right="0.0" top="0.0" bottom="0.0"/>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="dpI-Rq-Xuz">
<rect key="frame" x="1" y="224" width="218" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ys3-G3-wz7">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
<point key="canvasLocation" x="-130" y="-187"/>
</view>

View File

@@ -528,7 +528,7 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
// grpc
self.grpcServiceName.stringValue = v2rayConfig.streamGrpc.serviceName
self.grpcUseragent.stringValue = v2rayConfig.streamGrpc.user_agent
self.grpcUseragent.stringValue = v2rayConfig.streamGrpc.user_agent ?? ""
self.grpcMulti.intValue = v2rayConfig.streamGrpc.multiMode ? 1 : 0
// ========================== stream end =======================

View File

@@ -204,6 +204,16 @@ class ImportUri {
}
func importVmess(vmess: VmessUri) {
if vmess.fp.isEmpty {
vmess.fp = "chrome"
}
if vmess.security.isEmpty {
vmess.security = "none"
}
if vmess.sni.count == 0 {
vmess.sni = vmess.address
}
let v2ray = V2rayConfig()
var vmessItem = V2rayOutboundVMessItem()
@@ -232,12 +242,10 @@ class ImportUri {
v2ray.streamKcp.header.type = vmess.type
v2ray.streamKcp.uplinkCapacity = vmess.uplinkCapacity
v2ray.streamKcp.downlinkCapacity = vmess.downlinkCapacity
v2ray.streamKcp.seed = vmess.kcpSeed
// h2
if v2ray.streamH2.host.count == 0 {
v2ray.streamH2.host = [""]
}
v2ray.streamH2.host[0] = vmess.netHost
v2ray.streamH2.host = [vmess.netHost]
v2ray.streamH2.path = vmess.netPath
// ws
@@ -250,7 +258,13 @@ class ImportUri {
// tcp
v2ray.streamTcp.header.type = vmess.type
if v2ray.streamNetwork == "tcp" && v2ray.streamTcp.header.type == "http" {
var tcpReq = TcpSettingHeaderRequest()
tcpReq.path = [vmess.netPath]
tcpReq.headers.host = [vmess.netHost]
v2ray.streamTcp.header.request = tcpReq
}
// quic
v2ray.streamQuic.header.type = vmess.type
@@ -296,6 +310,19 @@ class ImportUri {
}
func importVless(vmess: VlessUri) {
if vmess.fp.isEmpty {
vmess.fp = "chrome"
}
if vmess.security.isEmpty {
vmess.security = "none"
}
if vmess.flow.isEmpty {
vmess.flow = "xtls-rprx-vision"
}
if vmess.sni.count == 0 {
vmess.sni = vmess.address
}
let v2ray = V2rayConfig()
v2ray.serverProtocol = V2rayProtocolOutbound.vless.rawValue
@@ -310,10 +337,6 @@ class ImportUri {
vmessItem.users = [user]
v2ray.serverVless = vmessItem
if vmess.sni.count == 0 {
vmess.sni = vmess.address
}
// stream
v2ray.streamNetwork = vmess.type
v2ray.streamSecurity = vmess.security
@@ -329,12 +352,10 @@ class ImportUri {
// kcp
v2ray.streamKcp.header.type = vmess.type
v2ray.streamKcp.seed = vmess.kcpSeed
// h2
if v2ray.streamH2.host.count == 0 {
v2ray.streamH2.host = [""]
}
v2ray.streamH2.host[0] = vmess.host
v2ray.streamH2.host = [vmess.host]
v2ray.streamH2.path = vmess.path
// ws
@@ -343,11 +364,17 @@ class ImportUri {
// grpc
v2ray.streamGrpc.serviceName = vmess.path
v2ray.streamGrpc.multiMode = vmess.type == "multi" // v2rayN
v2ray.streamGrpc.multiMode = vmess.grpcMode == "multi" // v2rayN
// tcp
v2ray.streamTcp.header.type = vmess.type
if v2ray.streamNetwork == "tcp" && v2ray.streamTcp.header.type == "http" {
var tcpReq = TcpSettingHeaderRequest()
tcpReq.path = [vmess.path]
tcpReq.headers.host = [vmess.host]
v2ray.streamTcp.header.request = tcpReq
}
// quic
v2ray.streamQuic.header.type = vmess.type
@@ -398,7 +425,6 @@ class ImportUri {
svr.address = trojan.host
svr.port = trojan.port
svr.password = trojan.password
svr.flow = trojan.flow
v2ray.serverTrojan = svr
v2ray.enableMux = false
@@ -492,7 +518,7 @@ func importByClash(clash: clashProxy) -> ImportUri? {
item.address = clash.server
item.port = clash.port
item.id = clash.uuid ?? ""
item.security = clash.cipher ?? "auto"
item.security = clash.cipher ?? "none" // vless encryption
item.type = clash.network ?? "tcp"
item.sni = clash.sni ?? clash.server
if clash.security == "reality" {

View File

@@ -149,7 +149,7 @@ class PingServer: NSObject, URLSessionDataDelegate {
vCfg.httpHost = "127.0.0.1"
vCfg.socksHost = "127.0.0.1"
vCfg.httpPort = String(bindPort)
vCfg.socksPort = String(bindPort + 1)
vCfg.socksPort = String(bindPort - 1)
jsonText = vCfg.combineManual()
do {

View File

@@ -109,14 +109,17 @@ final class PreferencePacViewController: NSViewController, PreferencePane {
let session = URLSession(configuration: getProxyUrlSessionConfigure())
let task = session.dataTask(with: URLRequest(url: reqUrl)){(data: Data?, response: URLResponse?, error: Error?) in
if error != nil {
self.tips.stringValue = "Failed to download latest GFW List: \(String(describing: error))"
DispatchQueue.main.async {
self.tips.stringValue = "Failed to download latest GFW List: \(String(describing: error))"
}
} else {
if data != nil {
if let outputStr = String(data: data!, encoding: String.Encoding.utf8) {
do {
try outputStr.write(toFile: GFWListFilePath, atomically: true, encoding: String.Encoding.utf8)
self.tips.stringValue = "gfwList has been updated"
DispatchQueue.main.async {
self.tips.stringValue = "gfwList has been updated"
}
NSLog("\(self.tips.stringValue)")
// save to UserDefaults
@@ -124,20 +127,28 @@ final class PreferencePacViewController: NSViewController, PreferencePane {
if GeneratePACFile(rewrite: true) {
// Popup a user notification
self.tips.stringValue = "PAC has been updated by latest GFW List."
DispatchQueue.main.async {
self.tips.stringValue = "PAC has been updated by latest GFW List."
}
NSLog("\(self.tips.stringValue)")
}
} catch {
// Popup a user notification
self.tips.stringValue = "Failed to Write latest GFW List."
DispatchQueue.main.async {
self.tips.stringValue = "Failed to Write latest GFW List."
}
NSLog("\(self.tips.stringValue)")
}
} else {
self.tips.stringValue = "Failed to download latest GFW List."
DispatchQueue.main.async {
self.tips.stringValue = "Failed to download latest GFW List."
}
}
} else {
// Popup a user notification
self.tips.stringValue = "Failed to download latest GFW List."
DispatchQueue.main.async {
self.tips.stringValue = "Failed to download latest GFW List."
}
self.tryDownloadByShell(gfwPacListUrl: gfwPacListUrl)
}
}
@@ -153,7 +164,9 @@ final class PreferencePacViewController: NSViewController, PreferencePane {
NSLog("curl result: \(msg)")
if GeneratePACFile(rewrite: true) {
// Popup a user notification
self.tips.stringValue = "PAC has been updated by latest GFW List."
DispatchQueue.main.async {
self.tips.stringValue = "PAC has been updated by latest GFW List."
}
}
}
}
@@ -256,6 +269,7 @@ func getPacUserRules() -> String {
||github.com
||chat.openai.com
||openai.com
||chatgpt.com
"""
do {
let url = URL(fileURLWithPath: PACUserRuleFilePath)

View File

@@ -149,14 +149,14 @@ final class PreferenceRoutingViewController: NSViewController, PreferencePane, N
@IBAction func goHelp(_ sender: Any) {
guard let url = URL(string: "https://toutyrater.github.io/basic/routing/") else {
guard let url = URL(string: "https://xtls.github.io/config/routing.html#routingobject") else {
return
}
NSWorkspace.shared.open(url)
}
@IBAction func goHelp2(_ sender: Any) {
guard let url = URL(string: "https://github.com/v2ray/domain-list-community") else {
guard let url = URL(string: "https://xtls.github.io/config/routing.html#routingobject") else {
return
}
NSWorkspace.shared.open(url)

View File

@@ -28,6 +28,8 @@ class VmessUri {
var alpn: String = ""
var sni: String = ""
var fp: String = ""
var grpcMode:String = ""
var kcpSeed:String = ""
/**
vmess://base64(security:uuid@host:port)?[urlencode(parameters)]
@@ -145,6 +147,13 @@ class VmessUri {
case "remark":
self.remark = param[1].urlDecoded()
break
case "serviceName":
self.netPath = param[1]
break
case "mode":
self.grpcMode = param[1]
case "seed":
self.kcpSeed = param[1]
default:
break
}
@@ -219,6 +228,8 @@ class VmessUri {
self.fp = json["fp"].stringValue
// type:none\http\srtp\utp\wechat-video
self.type = json["type"].stringValue
self.kcpSeed = json["seed"].stringValue
self.grpcMode = json["mode"].stringValue
}
}
@@ -519,6 +530,8 @@ class VlessUri {
var fp: String = "" // fingerprint
var pbk: String = "" // reality public key
var sid: String = "" // reality shortId
var grpcMode:String = ""
var kcpSeed:String = ""
// vless://f2a5064a-fabb-43ed-a2b6-8ffeb970df7f@00.com:443?flow=xtls-rprx-splite&encryption=none&security=xtls&sni=aaaaa&type=http&host=00.com&path=%2fvl#vless1
func encode() -> String {
@@ -538,6 +551,9 @@ class VlessUri {
URLQueryItem(name: "fp", value: self.fp),
URLQueryItem(name: "pbk", value: self.pbk),
URLQueryItem(name: "sid", value: self.sid),
URLQueryItem(name: "serviceName", value: self.path),
URLQueryItem(name: "mode", value: self.grpcMode),
URLQueryItem(name: "seed", value: self.kcpSeed)
]
return (uri.url?.absoluteString ?? "") + "#" + self.remark
@@ -567,6 +583,9 @@ class VlessUri {
break
case "flow":
self.flow = item.value as! String
if self.flow.isEmpty {
self.flow = "xtls-rprx-vision"
}
break
case "encryption":
self.encryption = item.value as! String
@@ -598,6 +617,18 @@ class VlessUri {
case "sid":
self.sid = item.value as! String
break
case "headerType":
self.type = item.value as! String
break
case "seed":
self.kcpSeed = item.value as! String
break
case "serviceName":
self.path = item.value as! String
break
case "mode":
self.grpcMode = item.value as! String
break
default:
break
}

View File

@@ -298,14 +298,14 @@ class RoutingItem: NSObject, NSCoding {
// parse default settings
func parseDefaultSettings() -> V2rayRouting {
var rules: [V2rayRoutingSettingRule] = []
var rules: [V2rayRoutingRule] = []
let (blockDomains, blockIps) = parseDomainOrIp(domainIpStr: self.block)
let (proxyDomains, proxyIps) = parseDomainOrIp(domainIpStr: self.proxy)
let (directDomains, directIps) = parseDomainOrIp(domainIpStr: self.direct)
// // rules
var ruleProxyDomain, ruleProxyIp, ruleDirectDomain, ruleDirectIp, ruleBlockDomain, ruleBlockIp, ruleDirectIpDefault, ruleDirectDomainDefault: V2rayRoutingSettingRule?
var ruleProxyDomain, ruleProxyIp, ruleDirectDomain, ruleDirectIp, ruleBlockDomain, ruleBlockIp, ruleDirectIpDefault, ruleDirectDomainDefault: V2rayRoutingRule?
// proxy
if proxyDomains.count > 0 {
ruleProxyDomain = getRoutingRule(outTag: "proxy", domain: proxyDomains, ip: nil, port: nil)
@@ -400,8 +400,8 @@ class RoutingItem: NSObject, NSCoding {
return settings
}
func getRoutingRule(outTag: String, domain:[String]?, ip: [String]?, port:String?) -> V2rayRoutingSettingRule {
var rule = V2rayRoutingSettingRule()
func getRoutingRule(outTag: String, domain:[String]?, ip: [String]?, port:String?) -> V2rayRoutingRule {
var rule = V2rayRoutingRule()
rule.outboundTag = outTag
rule.type = "field"
rule.domain = domain

View File

@@ -770,6 +770,12 @@ class V2rayConfig: NSObject {
user.id = val["id"].stringValue
user.flow = val["flow"].stringValue
user.encryption = val["encryption"].stringValue
if user.flow.isEmpty {
user.flow = "xtls-rprx-vision"
}
if user.encryption.isEmpty {
user.encryption = "none"
}
user.level = val["level"].intValue
users.append(user)
}

View File

@@ -100,18 +100,18 @@ struct TcpSettingHeader: Codable {
}
struct TcpSettingHeaderRequest: Codable {
var version: String = ""
var method: String = ""
var version: String = "1.1"
var method: String = "GET"
var path: [String] = []
var headers: TcpSettingHeaderRequestHeaders = TcpSettingHeaderRequestHeaders()
}
struct TcpSettingHeaderRequestHeaders: Codable {
var host: [String] = []
var userAgent: [String] = []
var acceptEncoding: [String] = []
var connection: [String] = []
var pragma: String = ""
var userAgent: [String] = ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"]
var acceptEncoding: [String] = ["gzip", "deflate"]
var connection: [String] = ["keep-alive"]
var pragma: String? = "no-cache"
enum CodingKeys: String, CodingKey {
case host = "Host"
@@ -147,6 +147,7 @@ struct KcpSettings: Codable {
var congestion: Bool = false
var readBufferSize: Int = 1
var writeBufferSize: Int = 1
var seed:String = ""
var header: KcpSettingsHeader = KcpSettingsHeader()
}
@@ -205,9 +206,10 @@ struct QuicSettingHeader: Codable {
}
struct GrpcSettings: Codable {
var authority: String?
var serviceName: String = ""
var multiMode: Bool = false
var user_agent: String = ""
var user_agent: String?
var idle_timeout: Int = 60
var health_check_timeout: Int = 60
var permit_without_stream: Bool = false

View File

@@ -65,22 +65,42 @@ struct V2rayRouting: Codable {
case IPIfNonMatch
case IPOnDemand
}
enum domainMatcher: String, Codable {
case hybrid
case linear
}
var domainStrategy: domainStrategy = .AsIs
var rules: [V2rayRoutingSettingRule] = []
var domainMatcher: domainMatcher?
var rules: [V2rayRoutingRule] = []
var balancers: [V2rayRoutingBalancer]? = []
}
struct V2rayRoutingSettingRule: Codable {
struct V2rayRoutingRule: Codable {
var domainMatcher: String?
var type: String = "field"
var domain: [String]? = []
var ip: [String]? = []
var port: String?
var sourcePort: String?
var network: String?
var source: [String]?
var user: [String]?
var inboundTag: [String]?
var `protocol`: [String]? // ["http", "tls", "bittorrent"]
var outboundTag: String? = "direct"
var balancerTag: String?
}
struct V2rayRoutingBalancer: Codable {
var selector: [String]?
var strategy: V2rayRoutingBalancerStrategy?
var tag: String?
var fallbackTag: String?
}
struct V2rayRoutingBalancerStrategy: Codable {
var type: String? // type : "random" | "roundRobin" | "leastPing" | "leastLoad"
}
struct V2rayPolicy: Codable {