Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenmrev committed Jun 1, 2018
1 parent 43e12ba commit 9e247a7
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 8 deletions.
4 changes: 4 additions & 0 deletions V2RayX.xcodeproj/project.pbxproj
Expand Up @@ -41,6 +41,7 @@
9D5EAC181FDCD70300C14B46 /* v2ray in Resources */ = {isa = PBXBuildFile; fileRef = 953B60571DB3F6B700D40654 /* v2ray */; };
9D7109611E0F43BD008A6362 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 9D7109601E0F43BD008A6362 /* Credits.rtf */; };
9D7DFE541EBEC947001FECBD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D7DFE531EBEC947001FECBD /* main.m */; };
9DA4A84120C14178000FF35D /* tcp_http_header_example.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9DA4A84020C14178000FF35D /* tcp_http_header_example.txt */; };
9DB4FE951F205BEB00CCEE5F /* config-sample.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DB4FE941F205BEB00CCEE5F /* config-sample.plist */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -134,6 +135,7 @@
9D7DFE511EBEC947001FECBD /* jsonplist */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = jsonplist; sourceTree = BUILT_PRODUCTS_DIR; };
9D7DFE531EBEC947001FECBD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
9DA398B5209ECED400784947 /* sysconf_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sysconf_version.h; sourceTree = "<group>"; };
9DA4A84020C14178000FF35D /* tcp_http_header_example.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tcp_http_header_example.txt; sourceTree = "<group>"; };
9DB4FE941F205BEB00CCEE5F /* config-sample.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "config-sample.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -211,6 +213,7 @@
isa = PBXGroup;
children = (
9DB4FE941F205BEB00CCEE5F /* config-sample.plist */,
9DA4A84020C14178000FF35D /* tcp_http_header_example.txt */,
95E524CA1C674CC80008BB12 /* simple.pac */,
9504C0D01C662E0800352520 /* install_helper.sh */,
953B60551DB3F65A00D40654 /* dlcore.sh */,
Expand Down Expand Up @@ -431,6 +434,7 @@
95E524CB1C674CC80008BB12 /* simple.pac in Resources */,
9504C0D11C66373400352520 /* install_helper.sh in Resources */,
9504C0CF1C662DE300352520 /* v2rayx_sysconf in Resources */,
9DA4A84120C14178000FF35D /* tcp_http_header_example.txt in Resources */,
9504C0821C662C3000352520 /* Assets.xcassets in Resources */,
9D7109611E0F43BD008A6362 /* Credits.rtf in Resources */,
9504C0851C662C3000352520 /* MainMenu.xib in Resources */,
Expand Down
3 changes: 3 additions & 0 deletions V2RayX/ConfigWindowController.m
Expand Up @@ -406,6 +406,9 @@ - (IBAction)tOK:(id)sender {
}
}];
}
- (IBAction)showKcpHeaderExample:(id)sender {
runCommandLine(@"/usr/bin/open", @[[[NSBundle mainBundle] pathForResource:@"tcp_http_header_example" ofType:@"txt"], @"-a", @"/Applications/TextEdit.app"]);
}

- (IBAction)useTLS:(id)sender {
[_tlsAiButton setEnabled:[_tlsUseButton state]];
Expand Down
29 changes: 29 additions & 0 deletions V2RayX/tcp_http_header_example.txt
@@ -0,0 +1,29 @@
{
"type": "http",
"request": {
"version": "1.1",
"method": "GET",
"path": ["/"],
"headers": {
"Host": ["www.baidu.com", "www.bing.com"],
"User-Agent": [
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
"Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
],
"Accept-Encoding": ["gzip, deflate"],
"Connection": ["keep-alive"],
"Pragma": "no-cache"
}
},
"response": {
"version": "1.1",
"status": "200",
"reason": "OK",
"headers": {
"Content-Type": ["application/octet-stream", "video/mpeg"],
"Transfer-Encoding": ["chunked"],
"Connection": ["keep-alive"],
"Pragma": "no-cache"
}
}
}
45 changes: 37 additions & 8 deletions V2RayX/transportWindow.xib
Expand Up @@ -262,6 +262,17 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WPK-rs-FWC">
<rect key="frame" x="197" y="115" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="See Example" bezelStyle="inline" alignment="center" borderStyle="border" inset="2" id="lrs-YU-384">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
</buttonCell>
<connections>
<action selector="showKcpHeaderExample:" target="-2" id="oXP-NW-lPj"/>
</connections>
</button>
</subviews>
</view>
</tabViewItem>
Expand Down Expand Up @@ -289,26 +300,26 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eKI-at-wEK">
<rect key="frame" x="15" y="85" width="165" height="17"/>
<rect key="frame" x="15" y="85" width="68" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="headers(JSON dictionary):" id="N1a-VD-e73">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="&quot;headers&quot;:" id="N1a-VD-e73">
<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>
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="evX-Qa-bJl">
<rect key="frame" x="17" y="9" width="443" height="68"/>
<rect key="frame" x="89" y="45" width="313" height="57"/>
<autoresizingMask key="autoresizingMask"/>
<clipView key="contentView" ambiguous="YES" id="Ijl-Ha-SNR">
<rect key="frame" x="1" y="1" width="441" height="66"/>
<rect key="frame" x="1" y="1" width="311" height="55"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView ambiguous="YES" importsGraphics="NO" richText="NO" verticallyResizable="YES" allowsCharacterPickerTouchBarItem="NO" allowsUndo="YES" allowsNonContiguousLayout="YES" textCompletion="NO" spellingCorrection="YES" id="5WV-Rv-Aia">
<rect key="frame" x="0.0" y="0.0" width="441" height="66"/>
<rect key="frame" x="0.0" y="0.0" width="311" height="55"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="441" height="66"/>
<size key="minSize" width="311" height="55"/>
<size key="maxSize" width="463" height="10000000"/>
<attributedString key="textStorage">
<fragment content=" ">
Expand All @@ -324,14 +335,32 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="qvr-My-otE">
<rect key="frame" x="1" y="-15" width="0.0" height="16"/>
<rect key="frame" x="1" y="40" width="305" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="Ekv-gJ-IED">
<rect key="frame" x="-15" y="1" width="16" height="0.0"/>
<rect key="frame" x="213" y="1" width="16" height="55"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pRh-vR-SHO">
<rect key="frame" x="87" y="17" width="157" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="{ &quot;Host&quot;: &quot;v2ray.com&quot; }" id="5Nf-oY-kxe">
<font key="font" metaFont="fixedUser" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HcW-Pz-OML">
<rect key="frame" x="20" y="17" width="63" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Example: " id="cJm-42-mob">
<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>
</subviews>
</view>
</tabViewItem>
Expand Down

0 comments on commit 9e247a7

Please sign in to comment.