mirror of
https://github.com/bolucat/Archive.git
synced 2025-09-26 20:21:35 +08:00
Update On Sun Jul 28 20:32:35 CEST 2024
This commit is contained in:
@@ -36,11 +36,10 @@
|
||||
<outlet property="kcpDownlinkCapacity" destination="56I-AM-Thb" id="s3q-QJ-8RH"/>
|
||||
<outlet property="kcpHeader" destination="8JB-cZ-Hzp" id="fUQ-D4-Tyu"/>
|
||||
<outlet property="kcpMtu" destination="bS7-lZ-JZ9" id="DcY-x3-Oor"/>
|
||||
<outlet property="kcpReadBufferSize" destination="Kwv-43-3ZS" id="wcL-iS-QWD"/>
|
||||
<outlet property="kcpSeed" destination="Kwv-43-3ZS" id="Msd-FA-Uze"/>
|
||||
<outlet property="kcpTti" destination="bBg-iY-haa" id="nsH-Gn-0Zc"/>
|
||||
<outlet property="kcpUplinkCapacity" destination="Tqs-Wj-roi" id="Lcp-W1-EJ2"/>
|
||||
<outlet property="kcpView" destination="rPy-7B-YDh" id="UKp-9S-ozl"/>
|
||||
<outlet property="kcpWriteBufferSize" destination="8Gm-6x-SqH" id="JUj-M3-hxe"/>
|
||||
<outlet property="muxConcurrent" destination="CkC-qQ-sQP" id="h7m-Db-YPe"/>
|
||||
<outlet property="networkView" destination="2EB-Eo-645" id="OdK-My-CAX"/>
|
||||
<outlet property="okBtn" destination="qgX-1j-8WD" id="4iT-yK-dLJ"/>
|
||||
@@ -73,6 +72,8 @@
|
||||
<outlet property="switchSecurity" destination="Y2a-uR-gaD" id="Qg1-bR-xho"/>
|
||||
<outlet property="tabView" destination="ppK-ei-cOI" id="UoC-e5-a6l"/>
|
||||
<outlet property="tcpHeaderType" destination="jBp-uN-mlt" id="74X-GP-Wt3"/>
|
||||
<outlet property="tcpHost" destination="59o-uJ-hWr" id="drd-7f-QLi"/>
|
||||
<outlet property="tcpPath" destination="dGb-XU-H9U" id="fpF-vq-xfU"/>
|
||||
<outlet property="tcpView" destination="vg1-BH-8Xk" id="6Ok-D2-5D2"/>
|
||||
<outlet property="tlsView" destination="ahS-zU-aaU" id="kP4-vt-HCe"/>
|
||||
<outlet property="trojanAddr" destination="o6g-Xu-aW1" id="NRf-1Q-wQJ"/>
|
||||
@@ -1145,17 +1146,59 @@ Gw
|
||||
<rect key="frame" x="-1" y="-1" width="360" height="80"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ryn-Hi-AoY">
|
||||
<rect key="frame" x="34" y="55" width="35" height="17"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="V9l-KB-Xgj">
|
||||
<rect key="frame" x="10" y="32" width="100" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="type:" id="uWr-DG-11J">
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="request path:" id="qCy-XA-jkC">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dGb-XU-H9U">
|
||||
<rect key="frame" x="110" y="32" width="177" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="wHP-S3-LkK">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<allowedInputSourceLocales>
|
||||
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
|
||||
</allowedInputSourceLocales>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yuJ-wg-IJa">
|
||||
<rect key="frame" x="10" y="10" width="100" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="request host:" id="z5C-Iv-zc2">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="59o-uJ-hWr">
|
||||
<rect key="frame" x="110" y="10" width="177" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="W7a-zN-J2n">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<allowedInputSourceLocales>
|
||||
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
|
||||
</allowedInputSourceLocales>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ryn-Hi-AoY" userLabel="header type:">
|
||||
<rect key="frame" x="10" y="55" width="100" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="header type:" id="uWr-DG-11J">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" horizontalCompressionResistancePriority="749" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jBp-uN-mlt" userLabel="headerType">
|
||||
<rect key="frame" x="75" y="50" width="100" height="26"/>
|
||||
<rect key="frame" x="110" y="50" width="100" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" title="none" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="Mg8-IY-rzv" id="ETG-0J-jI6">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
@@ -1172,24 +1215,6 @@ Gw
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bI5-6G-99s">
|
||||
<rect key="frame" x="15" y="32" width="54" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="request:" id="N8b-0p-IcF">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4P7-2c-NTM">
|
||||
<rect key="frame" x="5" y="10" width="64" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="response:" id="HMZ-z3-aYN">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rTW-bA-YBE">
|
||||
<rect key="frame" x="325" y="49" width="25" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
@@ -1201,24 +1226,6 @@ Gw
|
||||
</connections>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Slf-k5-KM1">
|
||||
<rect key="frame" x="75" y="32" width="282" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" title="please go to the "import" tab to edit manually." id="OPq-km-B7m">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="tertiaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dv1-56-sT0">
|
||||
<rect key="frame" x="75" y="11" width="282" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" title="please go to the "import" tab to edit manually." id="1In-OS-o1g">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="tertiaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
<view hidden="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rPy-7B-YDh" userLabel="kcp">
|
||||
@@ -1279,15 +1286,6 @@ Gw
|
||||
</allowedInputSourceLocales>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KJn-ym-pUC">
|
||||
<rect key="frame" x="28" y="10" width="94" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="readBufferSize" id="1bK-F6-yGg">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tqs-Wj-roi">
|
||||
<rect key="frame" x="114" y="29" width="50" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
@@ -1309,10 +1307,19 @@ Gw
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Kwv-43-3ZS">
|
||||
<rect key="frame" x="114" y="7" width="50" height="19"/>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KJn-ym-pUC" userLabel="seed">
|
||||
<rect key="frame" x="10" y="10" width="100" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="1" drawsBackground="YES" id="V8I-Yv-XUR">
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="seed" id="1bK-F6-yGg">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Kwv-43-3ZS">
|
||||
<rect key="frame" x="114" y="7" width="220" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="V8I-Yv-XUR">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -1330,27 +1337,6 @@ Gw
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zi6-s8-Vo6">
|
||||
<rect key="frame" x="197" y="10" width="97" height="14"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="writeBufferSize" id="2sZ-iB-yNg">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8Gm-6x-SqH">
|
||||
<rect key="frame" x="283" y="7" width="50" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="1" drawsBackground="YES" id="iAw-5i-dXk">
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<allowedInputSourceLocales>
|
||||
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
|
||||
</allowedInputSourceLocales>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BUA-Pf-he7">
|
||||
<rect key="frame" x="270" y="53" width="85" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
|
@@ -108,12 +108,13 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
|
||||
@IBOutlet weak var kcpTti: NSTextField!
|
||||
@IBOutlet weak var kcpUplinkCapacity: NSTextField!
|
||||
@IBOutlet weak var kcpDownlinkCapacity: NSTextField!
|
||||
@IBOutlet weak var kcpReadBufferSize: NSTextField!
|
||||
@IBOutlet weak var kcpWriteBufferSize: NSTextField!
|
||||
@IBOutlet weak var kcpSeed: NSTextField!
|
||||
@IBOutlet weak var kcpHeader: NSPopUpButton!
|
||||
@IBOutlet weak var kcpCongestion: NSButton!
|
||||
|
||||
@IBOutlet weak var tcpHeaderType: NSPopUpButton!
|
||||
@IBOutlet weak var tcpHost: NSTextField!
|
||||
@IBOutlet weak var tcpPath: NSTextField!
|
||||
|
||||
@IBOutlet weak var wsHost: NSTextField!
|
||||
@IBOutlet weak var wsPath: NSTextField!
|
||||
@@ -371,6 +372,12 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
|
||||
if self.tcpHeaderType.indexOfSelectedItem >= 0 {
|
||||
v2rayConfig.streamTcp.header.type = self.tcpHeaderType.titleOfSelectedItem!
|
||||
}
|
||||
if v2rayConfig.streamTcp.header.type == "http" {
|
||||
var tcpRequest = TcpSettingHeaderRequest()
|
||||
tcpRequest.path = [self.tcpPath.stringValue]
|
||||
tcpRequest.headers.host = [self.tcpHost.stringValue]
|
||||
v2rayConfig.streamTcp.header.request = tcpRequest
|
||||
}
|
||||
|
||||
// kcp
|
||||
if self.kcpHeader.indexOfSelectedItem >= 0 {
|
||||
@@ -380,8 +387,7 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
|
||||
v2rayConfig.streamKcp.tti = Int(self.kcpTti.intValue)
|
||||
v2rayConfig.streamKcp.uplinkCapacity = Int(self.kcpUplinkCapacity.intValue)
|
||||
v2rayConfig.streamKcp.downlinkCapacity = Int(self.kcpDownlinkCapacity.intValue)
|
||||
v2rayConfig.streamKcp.readBufferSize = Int(self.kcpReadBufferSize.intValue)
|
||||
v2rayConfig.streamKcp.writeBufferSize = Int(self.kcpWriteBufferSize.intValue)
|
||||
v2rayConfig.streamKcp.seed = self.kcpSeed.stringValue
|
||||
v2rayConfig.streamKcp.congestion = self.kcpCongestion.state.rawValue > 0
|
||||
|
||||
// h2
|
||||
@@ -499,6 +505,17 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
|
||||
|
||||
// tcp
|
||||
self.tcpHeaderType.selectItem(withTitle: v2rayConfig.streamTcp.header.type)
|
||||
if let req = v2rayConfig.streamTcp.header.request {
|
||||
if req.path.count>0 {
|
||||
self.tcpPath.stringValue = req.path[0]
|
||||
}
|
||||
if req.headers.host.count>0{
|
||||
self.tcpHost.stringValue = req.headers.host[0]
|
||||
}
|
||||
} else {
|
||||
self.tcpPath.stringValue = ""
|
||||
self.tcpHost.stringValue = ""
|
||||
}
|
||||
|
||||
// kcp
|
||||
self.kcpHeader.selectItem(withTitle: v2rayConfig.streamKcp.header.type)
|
||||
@@ -506,8 +523,7 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
|
||||
self.kcpTti.intValue = Int32(v2rayConfig.streamKcp.tti)
|
||||
self.kcpUplinkCapacity.intValue = Int32(v2rayConfig.streamKcp.uplinkCapacity)
|
||||
self.kcpDownlinkCapacity.intValue = Int32(v2rayConfig.streamKcp.downlinkCapacity)
|
||||
self.kcpReadBufferSize.intValue = Int32(v2rayConfig.streamKcp.readBufferSize)
|
||||
self.kcpWriteBufferSize.intValue = Int32(v2rayConfig.streamKcp.writeBufferSize)
|
||||
self.kcpSeed.stringValue = v2rayConfig.streamKcp.seed
|
||||
self.kcpCongestion.intValue = v2rayConfig.streamKcp.congestion ? 1 : 0
|
||||
|
||||
// h2
|
||||
|
@@ -335,7 +335,7 @@ class ImportUri {
|
||||
v2ray.serverVless = vmessItem
|
||||
|
||||
// stream
|
||||
v2ray.streamNetwork = vmess.type
|
||||
v2ray.streamNetwork = vmess.network
|
||||
v2ray.streamSecurity = vmess.security
|
||||
v2ray.securityTls.serverName = vmess.sni // default tls sni
|
||||
v2ray.securityTls.fingerprint = vmess.fp
|
||||
@@ -348,7 +348,7 @@ class ImportUri {
|
||||
}
|
||||
|
||||
// kcp
|
||||
v2ray.streamKcp.header.type = vmess.type
|
||||
v2ray.streamKcp.header.type = vmess.headerType
|
||||
v2ray.streamKcp.seed = vmess.kcpSeed
|
||||
|
||||
// h2
|
||||
@@ -364,7 +364,7 @@ class ImportUri {
|
||||
v2ray.streamGrpc.multiMode = vmess.grpcMode == "multi" // v2rayN
|
||||
|
||||
// tcp
|
||||
v2ray.streamTcp.header.type = vmess.type
|
||||
v2ray.streamTcp.header.type = vmess.headerType
|
||||
if v2ray.streamNetwork == "tcp" && v2ray.streamTcp.header.type == "http" {
|
||||
var tcpReq = TcpSettingHeaderRequest()
|
||||
tcpReq.path = [vmess.path]
|
||||
@@ -373,8 +373,10 @@ class ImportUri {
|
||||
}
|
||||
|
||||
// quic
|
||||
v2ray.streamQuic.header.type = vmess.type
|
||||
|
||||
v2ray.streamQuic.header.type = vmess.headerType
|
||||
|
||||
print("importVless-v2ray",v2ray.streamKcp,v2ray.streamKcp.seed)
|
||||
|
||||
// check is valid
|
||||
v2ray.checkManualValid()
|
||||
if v2ray.isValid {
|
||||
@@ -516,7 +518,7 @@ func importByClash(clash: clashProxy) -> ImportUri? {
|
||||
item.port = clash.port
|
||||
item.id = clash.uuid ?? ""
|
||||
item.security = clash.cipher ?? "none" // vless encryption
|
||||
item.type = clash.network ?? "tcp"
|
||||
item.network = clash.network ?? "tcp"
|
||||
item.sni = clash.sni ?? clash.server
|
||||
if clash.security == "reality" {
|
||||
item.sni = clash.servername ?? clash.server
|
||||
@@ -527,7 +529,7 @@ func importByClash(clash: clashProxy) -> ImportUri? {
|
||||
}
|
||||
}
|
||||
// network ws
|
||||
if item.type == "ws" {
|
||||
if item.network == "ws" {
|
||||
item.host = clash.servername ?? clash.server
|
||||
item.path = "/"
|
||||
if clash.wsOpts != nil {
|
||||
@@ -535,7 +537,7 @@ func importByClash(clash: clashProxy) -> ImportUri? {
|
||||
}
|
||||
}
|
||||
// network h2
|
||||
if item.type == "h2" {
|
||||
if item.network == "h2" {
|
||||
item.host = clash.servername ?? clash.server
|
||||
item.path = "/"
|
||||
if clash.h2Opts != nil {
|
||||
@@ -547,7 +549,7 @@ func importByClash(clash: clashProxy) -> ImportUri? {
|
||||
}
|
||||
}
|
||||
// network grpc
|
||||
if item.type == "grpc" {
|
||||
if item.network == "grpc" {
|
||||
item.host = clash.servername ?? clash.server
|
||||
if clash.grpcOpts != nil {
|
||||
item.path = clash.grpcOpts?.grpcServiceName ?? "/"
|
||||
|
@@ -11,14 +11,16 @@ struct VmessShare: Codable {
|
||||
var ps: String = ""
|
||||
var add: String = ""
|
||||
var port: String = ""
|
||||
var id: String = ""
|
||||
var aid: String = ""
|
||||
var net: String = ""
|
||||
var type: String = "none"
|
||||
var host: String = ""
|
||||
var path: String = ""
|
||||
var id: String = "" // UUID
|
||||
var aid: String = "" // alterId
|
||||
var net: String = "" // network type: (tcp\kcp\ws\h2\quic\ds\grpc)
|
||||
var type: String = "none" // 伪装类型(none\http\srtp\utp\wechat-video) *tcp or kcp or QUIC
|
||||
var host: String = "" // host: 1)http(tcp)->host中间逗号(,)隔开,2)ws->host,3)h2->host,4)QUIC->securty
|
||||
var path: String = "" // path: 1)ws->path,2)h2->path,3)QUIC->key/Kcp->seed,4)grpc->serviceName
|
||||
var tls: String = "tls"
|
||||
var security: String = "auto"
|
||||
var security: String = "auto" // 加密方式(security),没有时值默认auto
|
||||
var scy: String = "auto" // 同security
|
||||
var alpn: String = "" // h2,http/1.1
|
||||
var sni: String = ""
|
||||
var fp: String = ""
|
||||
}
|
||||
@@ -99,6 +101,34 @@ class ShareUri {
|
||||
}
|
||||
self.share.net = self.v2ray.streamNetwork
|
||||
|
||||
if self.v2ray.streamNetwork == "tcp" {
|
||||
self.share.type = self.v2ray.streamTcp.header.type
|
||||
if self.v2ray.streamTcp.header.type == "http" {
|
||||
if let req = self.v2ray.streamTcp.header.request {
|
||||
if req.path.count > 0 {
|
||||
self.share.path = req.path[0]
|
||||
}
|
||||
if req.headers.host.count>0 {
|
||||
self.share.host = req.headers.host[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "kcp" {
|
||||
self.share.type = self.v2ray.streamKcp.header.type
|
||||
self.share.path = self.v2ray.streamKcp.seed
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "quic" {
|
||||
self.share.type = self.v2ray.streamQuic.header.type
|
||||
self.share.path = self.v2ray.streamQuic.key
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "domainsocket" {
|
||||
self.share.path = self.v2ray.streamDs.path
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "h2" {
|
||||
if self.v2ray.streamH2.host.count > 0 {
|
||||
self.share.host = self.v2ray.streamH2.host[0]
|
||||
@@ -183,8 +213,36 @@ class ShareUri {
|
||||
ss.fp = self.v2ray.securityTls.fingerprint
|
||||
}
|
||||
|
||||
ss.type = self.v2ray.streamNetwork
|
||||
ss.network = self.v2ray.streamNetwork
|
||||
|
||||
if self.v2ray.streamNetwork == "tcp" {
|
||||
ss.headerType = self.v2ray.streamTcp.header.type
|
||||
if self.v2ray.streamTcp.header.type == "http" {
|
||||
if let req = self.v2ray.streamTcp.header.request {
|
||||
if req.path.count > 0 {
|
||||
ss.path = req.path[0]
|
||||
}
|
||||
if req.headers.host.count>0 {
|
||||
ss.host = req.headers.host[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "kcp" {
|
||||
ss.headerType = self.v2ray.streamKcp.header.type
|
||||
ss.kcpSeed = self.v2ray.streamKcp.seed
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "quic" {
|
||||
ss.headerType = self.v2ray.streamQuic.header.type
|
||||
ss.kcpSeed = self.v2ray.streamQuic.key
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "domainsocket" {
|
||||
ss.path = self.v2ray.streamDs.path
|
||||
}
|
||||
|
||||
if self.v2ray.streamNetwork == "h2" {
|
||||
if self.v2ray.streamH2.host.count > 0 {
|
||||
ss.host = self.v2ray.streamH2.host[0]
|
||||
|
@@ -520,10 +520,11 @@ class VlessUri {
|
||||
var level: Int = 0
|
||||
var flow: String = ""
|
||||
|
||||
var encryption: String = "" // auto,aes-128-gcm,...
|
||||
var encryption: String = "" // none,auto,aes-128-gcm,...
|
||||
var security: String = "" // xtls,tls,reality
|
||||
|
||||
var type: String = "" // tcp,http
|
||||
|
||||
var network: String = "" // network type: tcp,http,kcp,h2,ws,quic,grpc,domainsocket
|
||||
var headerType: String = "" // header type: tcp=["none","http"],quic,kcp=["none", "srtp", "utp", "wechat-video", "dtls", "wireguard"]
|
||||
var host: String = ""
|
||||
var sni: String = ""
|
||||
var path: String = ""
|
||||
@@ -544,7 +545,7 @@ class VlessUri {
|
||||
URLQueryItem(name: "flow", value: self.flow),
|
||||
URLQueryItem(name: "security", value: self.security),
|
||||
URLQueryItem(name: "encryption", value: self.encryption),
|
||||
URLQueryItem(name: "type", value: self.type),
|
||||
URLQueryItem(name: "type", value: self.network), // 网络类型: tcp,http,kcp,h2,ws,quic,grpc,domainsocket
|
||||
URLQueryItem(name: "host", value: self.host),
|
||||
URLQueryItem(name: "path", value: self.path),
|
||||
URLQueryItem(name: "sni", value: self.sni),
|
||||
@@ -552,6 +553,7 @@ class VlessUri {
|
||||
URLQueryItem(name: "pbk", value: self.pbk),
|
||||
URLQueryItem(name: "sid", value: self.sid),
|
||||
URLQueryItem(name: "serviceName", value: self.path),
|
||||
URLQueryItem(name: "headerType", value: self.headerType),
|
||||
URLQueryItem(name: "mode", value: self.grpcMode),
|
||||
URLQueryItem(name: "seed", value: self.kcpSeed)
|
||||
]
|
||||
@@ -594,7 +596,7 @@ class VlessUri {
|
||||
self.security = item.value as! String
|
||||
break
|
||||
case "type":
|
||||
self.type = item.value as! String
|
||||
self.network = item.value as! String
|
||||
break
|
||||
case "host":
|
||||
self.host = item.value as! String
|
||||
@@ -615,7 +617,7 @@ class VlessUri {
|
||||
self.sid = item.value as! String
|
||||
break
|
||||
case "headerType":
|
||||
self.type = item.value as! String
|
||||
self.headerType = item.value as! String
|
||||
break
|
||||
case "seed":
|
||||
self.kcpSeed = item.value as! String
|
||||
|
@@ -922,6 +922,7 @@ class V2rayConfig: NSObject {
|
||||
|
||||
if transport.kcpSettings != nil {
|
||||
self.streamKcp = transport.kcpSettings!
|
||||
print("self.streamKcp",self.streamKcp)
|
||||
}
|
||||
|
||||
if transport.wsSettings != nil {
|
||||
@@ -1100,6 +1101,7 @@ class V2rayConfig: NSObject {
|
||||
kcpSettings.congestion = streamJson["kcpSettings"]["congestion"].boolValue
|
||||
kcpSettings.readBufferSize = streamJson["kcpSettings"]["readBufferSize"].intValue
|
||||
kcpSettings.writeBufferSize = streamJson["kcpSettings"]["writeBufferSize"].intValue
|
||||
kcpSettings.seed = streamJson["kcpSettings"]["seed"].stringValue
|
||||
// "none"
|
||||
if KcpSettingsHeaderType.firstIndex(of: streamJson["kcpSettings"]["header"]["type"].stringValue) != nil {
|
||||
kcpSettings.header.type = streamJson["kcpSettings"]["header"]["type"].stringValue
|
||||
|
@@ -102,7 +102,7 @@ struct TcpSettingHeader: Codable {
|
||||
struct TcpSettingHeaderRequest: Codable {
|
||||
var version: String = "1.1"
|
||||
var method: String = "GET"
|
||||
var path: [String] = []
|
||||
var path: [String] = [""]
|
||||
var headers: TcpSettingHeaderRequestHeaders = TcpSettingHeaderRequestHeaders()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user