Merge branch 'pr/1056' into develop
This commit is contained in:
@ -93,6 +93,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
"ShadowsocksRunningMode": "auto",
|
||||
"LocalSocks5.ListenPort": NSNumber(value: 1086 as UInt16),
|
||||
"LocalSocks5.ListenAddress": "127.0.0.1",
|
||||
"PacServer.ListenAddress":"127.0.0.1",
|
||||
"PacServer.ListenPort":NSNumber(value: 1089 as UInt16),
|
||||
"LocalSocks5.Timeout": NSNumber(value: 60 as UInt),
|
||||
"LocalSocks5.EnableUDPRelay": NSNumber(value: false as Bool),
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@ -15,14 +15,14 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="609" y="533" width="480" height="326"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
|
||||
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="326"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tabView type="noTabsNoBorder" translatesAutoresizingMaskIntoConstraints="NO" id="h22-uy-K1x">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="326"/>
|
||||
@ -92,7 +92,7 @@
|
||||
</constraints>
|
||||
<textFieldCell key="cell" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" drawsBackground="YES" id="YqN-0f-ODA">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -134,7 +134,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="r8z-mM-M0X">
|
||||
<rect key="frame" x="35" y="254" width="201" height="17"/>
|
||||
<rect key="frame" x="35" y="255" width="201" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Local Socks5 Listen Port:" id="8fk-fw-Tsx">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -156,7 +156,7 @@
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="LBl-2M-X7O">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -168,7 +168,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MvY-R0-1FU">
|
||||
<rect key="frame" x="35" y="190" width="201" height="17"/>
|
||||
<rect key="frame" x="35" y="159" width="201" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Timeout:" id="sQ9-bj-V0I">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -176,10 +176,10 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zfl-10-Wdk">
|
||||
<rect key="frame" x="242" y="188" width="60" height="22"/>
|
||||
<rect key="frame" x="242" y="156" width="60" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" drawsBackground="YES" id="Ity-ir-Fyi">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -192,7 +192,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="tGd-pe-2xJ">
|
||||
<rect key="frame" x="240" y="164" width="222" height="18"/>
|
||||
<rect key="frame" x="240" y="132" width="222" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Enable UDP Relay" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="R3v-iN-zu8">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@ -208,7 +208,7 @@
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" drawsBackground="YES" id="MV1-4D-sap">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -221,7 +221,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="a60-LH-adV">
|
||||
<rect key="frame" x="308" y="190" width="99" height="17"/>
|
||||
<rect key="frame" x="308" y="159" width="99" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="95" id="eAo-vP-NxC"/>
|
||||
</constraints>
|
||||
@ -232,7 +232,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="RcT-mn-xqK">
|
||||
<rect key="frame" x="240" y="144" width="222" height="18"/>
|
||||
<rect key="frame" x="240" y="112" width="222" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Enable Verbose Mode" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="cIS-Wb-Rzg">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@ -242,7 +242,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RYj-h6-uAT">
|
||||
<rect key="frame" x="35" y="222" width="201" height="17"/>
|
||||
<rect key="frame" x="35" y="191" width="201" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Local PAC Server Listen Port:" id="IMQ-c4-gmc">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -250,10 +250,10 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KXG-O0-ake">
|
||||
<rect key="frame" x="242" y="220" width="60" height="22"/>
|
||||
<rect key="frame" x="242" y="188" width="60" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" drawsBackground="YES" id="T9o-Og-neF">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -265,32 +265,62 @@
|
||||
<outlet property="formatter" destination="C7t-aU-bub" id="3M6-FE-SDQ"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GR0-SX-ali">
|
||||
<rect key="frame" x="242" y="220" width="218" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="218" id="q5c-ka-uIb"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="fYc-xd-hb5">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="uQz-5y-ZL2" name="value" keyPath="values.PacServer.ListenAddress" id="tFH-sJ-yeg">
|
||||
<dictionary key="options">
|
||||
<bool key="NSContinuouslyUpdatesValue" value="YES"/>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mhO-vS-JmZ">
|
||||
<rect key="frame" x="31" y="224" width="205" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Local PAC Server Listen Address:" id="80e-Qu-r2S">
|
||||
<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>
|
||||
<constraints>
|
||||
<constraint firstItem="GR0-SX-ali" firstAttribute="leading" secondItem="mhO-vS-JmZ" secondAttribute="trailing" constant="8" symbolic="YES" id="1eL-t5-ROL"/>
|
||||
<constraint firstItem="cd8-PU-OwG" firstAttribute="top" secondItem="Pc1-f7-0zA" secondAttribute="top" constant="20" symbolic="YES" id="2xI-Je-UBj"/>
|
||||
<constraint firstItem="r8z-mM-M0X" firstAttribute="centerY" secondItem="2rw-0u-LXJ" secondAttribute="centerY" id="5fA-ZQ-ZjQ"/>
|
||||
<constraint firstItem="r8z-mM-M0X" firstAttribute="leading" secondItem="MvY-R0-1FU" secondAttribute="leading" id="6eA-0g-irI"/>
|
||||
<constraint firstItem="KXG-O0-ake" firstAttribute="top" secondItem="GR0-SX-ali" secondAttribute="bottom" constant="10" id="6hk-lL-BVV"/>
|
||||
<constraint firstItem="KXG-O0-ake" firstAttribute="leading" secondItem="RYj-h6-uAT" secondAttribute="trailing" constant="8" symbolic="YES" id="A8d-Yi-iPY"/>
|
||||
<constraint firstItem="2rw-0u-LXJ" firstAttribute="leading" secondItem="KXG-O0-ake" secondAttribute="leading" id="BmQ-43-oEu"/>
|
||||
<constraint firstItem="tGd-pe-2xJ" firstAttribute="top" secondItem="Zfl-10-Wdk" secondAttribute="bottom" constant="8" symbolic="YES" id="D9d-1I-YcC"/>
|
||||
<constraint firstItem="2rw-0u-LXJ" firstAttribute="trailing" secondItem="KXG-O0-ake" secondAttribute="trailing" id="Dlo-y8-pDH"/>
|
||||
<constraint firstItem="Zfl-10-Wdk" firstAttribute="leading" secondItem="tGd-pe-2xJ" secondAttribute="leading" id="ERU-7y-65C"/>
|
||||
<constraint firstItem="mhO-vS-JmZ" firstAttribute="top" secondItem="r8z-mM-M0X" secondAttribute="bottom" constant="14" id="Gkb-b5-cRz"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tGd-pe-2xJ" secondAttribute="trailing" constant="20" symbolic="YES" id="Hu7-bS-L8S"/>
|
||||
<constraint firstItem="KXG-O0-ake" firstAttribute="leading" secondItem="Zfl-10-Wdk" secondAttribute="leading" id="JAW-8x-8Ec"/>
|
||||
<constraint firstItem="cd8-PU-OwG" firstAttribute="baseline" secondItem="c8B-qf-UNK" secondAttribute="baseline" id="KfL-wl-9vw"/>
|
||||
<constraint firstItem="c8B-qf-UNK" firstAttribute="leading" secondItem="Pc1-f7-0zA" secondAttribute="leading" constant="37" id="O7u-jq-IpO"/>
|
||||
<constraint firstItem="Zfl-10-Wdk" firstAttribute="leading" secondItem="MvY-R0-1FU" secondAttribute="trailing" constant="8" symbolic="YES" id="OMl-E5-RNK"/>
|
||||
<constraint firstItem="GR0-SX-ali" firstAttribute="top" secondItem="2rw-0u-LXJ" secondAttribute="bottom" constant="10" id="PPs-CT-Y2D"/>
|
||||
<constraint firstItem="2rw-0u-LXJ" firstAttribute="top" secondItem="cd8-PU-OwG" secondAttribute="bottom" constant="10" symbolic="YES" id="PZS-om-WoS"/>
|
||||
<constraint firstItem="RYj-h6-uAT" firstAttribute="centerY" secondItem="KXG-O0-ake" secondAttribute="centerY" id="Qyf-RP-hha"/>
|
||||
<constraint firstItem="a60-LH-adV" firstAttribute="leading" secondItem="Zfl-10-Wdk" secondAttribute="trailing" constant="8" symbolic="YES" id="W19-Vm-mO0"/>
|
||||
<constraint firstItem="2rw-0u-LXJ" firstAttribute="leading" secondItem="r8z-mM-M0X" secondAttribute="trailing" constant="8" symbolic="YES" id="Ysf-HF-2KD"/>
|
||||
<constraint firstItem="tGd-pe-2xJ" firstAttribute="trailing" secondItem="RcT-mn-xqK" secondAttribute="trailing" id="agb-Xy-AfZ"/>
|
||||
<constraint firstItem="Zfl-10-Wdk" firstAttribute="centerY" secondItem="a60-LH-adV" secondAttribute="centerY" id="cqe-kg-5MV"/>
|
||||
<constraint firstAttribute="trailing" secondItem="GR0-SX-ali" secondAttribute="trailing" constant="20" id="eIh-9C-JjK"/>
|
||||
<constraint firstItem="MvY-R0-1FU" firstAttribute="baseline" secondItem="a60-LH-adV" secondAttribute="baseline" id="eUT-gJ-nfA"/>
|
||||
<constraint firstItem="RYj-h6-uAT" firstAttribute="leading" secondItem="r8z-mM-M0X" secondAttribute="leading" id="igM-ki-qeU"/>
|
||||
<constraint firstItem="Zfl-10-Wdk" firstAttribute="top" secondItem="KXG-O0-ake" secondAttribute="bottom" constant="10" symbolic="YES" id="mgU-8h-vo1"/>
|
||||
<constraint firstItem="cd8-PU-OwG" firstAttribute="trailing" secondItem="tGd-pe-2xJ" secondAttribute="trailing" id="nNG-Uo-SoT"/>
|
||||
<constraint firstItem="KXG-O0-ake" firstAttribute="top" secondItem="2rw-0u-LXJ" secondAttribute="bottom" constant="10" symbolic="YES" id="nQG-MA-bW1"/>
|
||||
<constraint firstItem="tGd-pe-2xJ" firstAttribute="leading" secondItem="RcT-mn-xqK" secondAttribute="leading" id="oCa-3p-Nbm"/>
|
||||
<constraint firstItem="RcT-mn-xqK" firstAttribute="top" secondItem="tGd-pe-2xJ" secondAttribute="bottom" constant="6" symbolic="YES" id="qWE-ve-msF"/>
|
||||
<constraint firstItem="KXG-O0-ake" firstAttribute="trailing" secondItem="Zfl-10-Wdk" secondAttribute="trailing" id="s8J-cx-cKI"/>
|
||||
@ -306,7 +336,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XI2-x3-9ie">
|
||||
<rect key="frame" x="18" y="286" width="217" height="17"/>
|
||||
<rect key="frame" x="18" y="287" width="217" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="HTTP Proxy Listen Address:" id="6W4-TY-Bw5">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -314,7 +344,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="URa-Z3-BgW">
|
||||
<rect key="frame" x="18" y="254" width="217" height="17"/>
|
||||
<rect key="frame" x="18" y="255" width="217" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="HTTP Proxy Listen Port:" id="Ww9-j9-WYR">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -325,7 +355,7 @@
|
||||
<rect key="frame" x="247" y="284" width="213" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="p6k-oG-17u">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -340,7 +370,7 @@
|
||||
<rect key="frame" x="247" y="252" width="70" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" drawsBackground="YES" id="0bX-LS-7QW">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
@ -406,7 +436,7 @@
|
||||
<rect key="frame" x="20" y="111" width="440" height="119"/>
|
||||
<clipView key="contentView" id="9Wy-0J-wQ8">
|
||||
<rect key="frame" x="1" y="1" width="438" height="117"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" id="Vp3-dp-iqv">
|
||||
<rect key="frame" x="0.0" y="0.0" width="438" height="117"/>
|
||||
@ -415,7 +445,7 @@
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn identifier="" width="435" minWidth="40" maxWidth="1000" id="4CL-dk-HUu">
|
||||
<tableColumn width="435" minWidth="40" maxWidth="1000" id="4CL-dk-HUu">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@ -443,11 +473,11 @@
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="440" id="0eu-YD-CLG"/>
|
||||
</constraints>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="FHm-ib-d94">
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="FHm-ib-d94">
|
||||
<rect key="frame" x="-7" y="-14" width="0.0" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="sEE-Wn-Fcs">
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="sEE-Wn-Fcs">
|
||||
<rect key="frame" x="94" y="1" width="15" height="0.0"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
@ -478,7 +508,7 @@
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="g2Z-r8-ipF">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
|
@ -41,6 +41,7 @@ func diagnose() -> String {
|
||||
"ShadowsocksRunningMode",
|
||||
"LocalSocks5.ListenPort",
|
||||
"LocalSocks5.ListenAddress",
|
||||
"PacServer.ListenAddress",
|
||||
"PacServer.ListenPort",
|
||||
"LocalSocks5.Timeout",
|
||||
"LocalSocks5.EnableUDPRelay",
|
||||
|
@ -153,18 +153,21 @@ GCDWebServer *webServer =nil;
|
||||
}
|
||||
|
||||
+ (void)enableGlobalProxy {
|
||||
NSString* socks5ListenAddress = [[NSUserDefaults standardUserDefaults]stringForKey:@"LocalSocks5.ListenAddress"];
|
||||
NSUInteger port = [[NSUserDefaults standardUserDefaults]integerForKey:@"LocalSocks5.ListenPort"];
|
||||
|
||||
NSMutableArray* args = [@[@"--mode", @"global", @"--port"
|
||||
, [NSString stringWithFormat:@"%lu", (unsigned long)port]]mutableCopy];
|
||||
, [NSString stringWithFormat:@"%lu", (unsigned long)port],@"--socks-listen-address",socks5ListenAddress]mutableCopy];
|
||||
|
||||
// Because issue #106 https://github.com/shadowsocks/ShadowsocksX-NG/issues/106
|
||||
// Comment below out.
|
||||
// if ([[NSUserDefaults standardUserDefaults] boolForKey:@"LocalHTTPOn"] && [[NSUserDefaults standardUserDefaults] boolForKey:@"LocalHTTP.FollowGlobal"]) {
|
||||
// NSUInteger privoxyPort = [[NSUserDefaults standardUserDefaults]integerForKey:@"LocalHTTP.ListenPort"];
|
||||
//
|
||||
// NSString* privoxyListenAddress = [[NSUserDefaults standardUserDefaults]stringForKey:@"LocalHTTP.ListenAddress"];
|
||||
// [args addObject:@"--privoxy-port"];
|
||||
// [args addObject:[NSString stringWithFormat:@"%lu", (unsigned long)privoxyPort]];
|
||||
// [args addObject:@"--privoxy-listen-address"];
|
||||
// [args addObject:privoxyListenAddress];
|
||||
// }
|
||||
|
||||
[self addArguments4ManualSpecifyNetworkServices:args];
|
||||
@ -193,7 +196,7 @@ GCDWebServer *webServer =nil;
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSString * address = @"127.0.0.1";
|
||||
NSString * address = [defaults stringForKey:@"PacServer.ListenAddress"];
|
||||
int port = (short)[defaults integerForKey:@"PacServer.ListenPort"];
|
||||
|
||||
return [NSString stringWithFormat:@"%@%@:%d%@",@"http://",address,port,routerPath];
|
||||
@ -207,6 +210,8 @@ GCDWebServer *webServer =nil;
|
||||
NSData* originalPACData = [NSData dataWithContentsOfFile:PACFilePath];
|
||||
|
||||
webServer = [[GCDWebServer alloc] init];
|
||||
|
||||
|
||||
[webServer addHandlerForMethod:@"GET"
|
||||
path:routerPath
|
||||
requestClass:[GCDWebServerRequest class]
|
||||
@ -220,9 +225,10 @@ GCDWebServer *webServer =nil;
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSString * address = [defaults stringForKey:@"PacServer.ListenAddress"];
|
||||
int port = (short)[defaults integerForKey:@"PacServer.ListenPort"];
|
||||
|
||||
[webServer startWithOptions:@{@"BindToLocalhost":@YES, @"Port":@(port)} error:nil];
|
||||
[webServer startWithOptions:@{@"ServerName":address,@"Port":@(port)} error:nil];
|
||||
}
|
||||
|
||||
+ (void)stopPACServer {
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Seconds"; ObjectID = "4R2-UO-qs7"; */
|
||||
"4R2-UO-qs7.title" = "秒";
|
||||
|
||||
@ -53,6 +52,9 @@
|
||||
/* Class = "NSTextFieldCell"; title = "Num of Kcptun connections:"; ObjectID = "FSi-9j-QBe"; */
|
||||
"FSi-9j-QBe.title" = "Num of Kcptun connections:";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Local PAC Server Listen Address:"; ObjectID = "80e-Qu-r2S"; */
|
||||
"80e-Qu-r2S.title" = "本地PAC服务器监听地址:";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Local PAC Server Listen Port:"; ObjectID = "IMQ-c4-gmc"; */
|
||||
"IMQ-c4-gmc.title" = "本地PAC服务器监听端口:";
|
||||
|
||||
|
@ -22,10 +22,12 @@ int main(int argc, const char * argv[])
|
||||
NSString* mode;
|
||||
NSString* pacURL;
|
||||
NSString* portString;
|
||||
NSString* socks5ListenAddress;
|
||||
NSString* privoxyPortString;
|
||||
NSString* privoxyListenAddress;
|
||||
|
||||
BRLOptionParser *options = [BRLOptionParser new];
|
||||
[options setBanner:@"Usage: %s [-v] [-m auto|global|off] [-u <url>] [-p <port>] [-r <port>] [-x <exception>]", argv[0]];
|
||||
[options setBanner:@"Usage: %s [-v] [-m auto|global|off] [-u <url>] [-p <port>] [-l <socks5-listen-address>] [-r <port>] [-p <privoxy-listen-address>] [-x <exception>]", argv[0]];
|
||||
|
||||
// Version
|
||||
[options addOption:"version" flag:'v' description:@"Print the version number." block:^{
|
||||
@ -45,8 +47,10 @@ int main(int argc, const char * argv[])
|
||||
|
||||
[options addOption:"pac-url" flag:'u' description:@"PAC file url for auto mode." argument:&pacURL];
|
||||
[options addOption:"port" flag:'p' description:@"Listen port for global mode." argument:&portString];
|
||||
[options addOption:"socks-listen-address" flag:'l' description:@"Listen socks5 address for global mode." argument:&socks5ListenAddress];
|
||||
|
||||
[options addOption:"privoxy-port" flag:'r' description:@"Privoxy Port for global mode." argument:&privoxyPortString];
|
||||
[options addOption:"privoxy-listen-address" flag:'s' description:@"Privoxy Listen Address for global mode." argument:&privoxyListenAddress];
|
||||
|
||||
NSMutableSet* networkServiceKeys = [NSMutableSet set];
|
||||
[options addOption:"network-service" flag:'n' description:@"Manual specify the network profile need to set proxy." blockWithArgument:^(NSString* value){
|
||||
@ -157,7 +161,7 @@ int main(int argc, const char * argv[])
|
||||
} else if ([mode isEqualToString:@"global"]) {
|
||||
|
||||
|
||||
[proxies setObject:@"127.0.0.1" forKey:(NSString *)
|
||||
[proxies setObject:socks5ListenAddress forKey:(NSString *)
|
||||
kCFNetworkProxiesSOCKSProxy];
|
||||
[proxies setObject:[NSNumber numberWithInteger:port] forKey:(NSString*)
|
||||
kCFNetworkProxiesSOCKSPort];
|
||||
@ -166,14 +170,14 @@ int main(int argc, const char * argv[])
|
||||
[proxies setObject:[proxyExceptions allObjects] forKey:(NSString *)kCFNetworkProxiesExceptionsList];
|
||||
|
||||
if (privoxyPort != 0) {
|
||||
[proxies setObject:@"127.0.0.1" forKey:(NSString *)
|
||||
[proxies setObject:privoxyListenAddress forKey:(NSString *)
|
||||
kCFNetworkProxiesHTTPProxy];
|
||||
[proxies setObject:[NSNumber numberWithInteger:privoxyPort] forKey:(NSString*)
|
||||
kCFNetworkProxiesHTTPPort];
|
||||
[proxies setObject:[NSNumber numberWithInt:1] forKey:(NSString*)
|
||||
kCFNetworkProxiesHTTPEnable];
|
||||
|
||||
[proxies setObject:@"127.0.0.1" forKey:(NSString *)
|
||||
[proxies setObject:privoxyListenAddress forKey:(NSString *)
|
||||
kCFNetworkProxiesHTTPSProxy];
|
||||
[proxies setObject:[NSNumber numberWithInteger:privoxyPort] forKey:(NSString*)
|
||||
kCFNetworkProxiesHTTPSPort];
|
||||
|
Reference in New Issue
Block a user