├── .editorconfig
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── Screenshots
├── TCS00.png
├── TCS240.png
└── TCS300P2.png
├── TCS.sln
└── TCS
├── App.config
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
├── Settings.settings
└── app.manifest
├── TCS.Designer.cs
├── TCS.cs
├── TCS.csproj
├── TCS.resx
├── UrlNode.Designer.cs
├── UrlNode.cs
├── UrlNode.resx
├── Util
├── Command.cs
├── Config.cs
├── Encrypt.cs
├── Http.cs
├── LnkHelper.cs
├── Message.cs
├── NodeList.cs
├── Proxy.cs
├── ShareLink.cs
├── SniList.cs
└── TCSPath.cs
├── clash
├── Country.mmdb
├── clash.exe
└── config.yaml
├── icon.ico
├── logo.ico
├── packages.config
├── privoxy
├── config.txt
├── config_gfw.txt
├── gfwlist.action
└── privoxy.exe
└── trojan
├── config.json
└── trojan.exe
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CA1031: Do not catch general exception types
4 | dotnet_diagnostic.CA1031.severity = silent
5 |
6 | # CA1307: 指定 StringComparison
7 | dotnet_diagnostic.CA1307.severity = suggestion
8 |
9 | # CA1062: 验证公共方法的参数
10 | dotnet_diagnostic.CA1062.severity = silent
11 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # Visual Basic files
7 | *.vb
8 |
9 | # User-specific files
10 | *.rsuser
11 | *.suo
12 | *.user
13 | *.userosscache
14 | *.sln.docstates
15 |
16 | # User-specific files (MonoDevelop/Xamarin Studio)
17 | *.userprefs
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 |
33 | # Visual Studio 2015/2017 cache/options directory
34 | .vs/
35 | # Uncomment if you have tasks that create the project's static files in wwwroot
36 | #wwwroot/
37 |
38 | # Visual Studio 2017 auto generated files
39 | Generated\ Files/
40 |
41 | # MSTest test Results
42 | [Tt]est[Rr]esult*/
43 | [Bb]uild[Ll]og.*
44 |
45 | # NUNIT
46 | *.VisualState.xml
47 | TestResult.xml
48 |
49 | # Build Results of an ATL Project
50 | [Dd]ebugPS/
51 | [Rr]eleasePS/
52 | dlldata.c
53 |
54 | # Benchmark Results
55 | BenchmarkDotNet.Artifacts/
56 |
57 | # .NET Core
58 | project.lock.json
59 | project.fragment.lock.json
60 | artifacts/
61 |
62 | # StyleCop
63 | StyleCopReport.xml
64 |
65 | # Files built by Visual Studio
66 | *_i.c
67 | *_p.c
68 | *_h.h
69 | *.ilk
70 | *.meta
71 | *.obj
72 | *.iobj
73 | *.pch
74 | *.pdb
75 | *.ipdb
76 | *.pgc
77 | *.pgd
78 | *.rsp
79 | *.sbr
80 | *.tlb
81 | *.tli
82 | *.tlh
83 | *.tmp
84 | *.tmp_proj
85 | *_wpftmp.csproj
86 | *.log
87 | *.vspscc
88 | *.vssscc
89 | .builds
90 | *.pidb
91 | *.svclog
92 | *.scc
93 |
94 | # Chutzpah Test files
95 | _Chutzpah*
96 |
97 | # Visual C++ cache files
98 | ipch/
99 | *.aps
100 | *.ncb
101 | *.opendb
102 | *.opensdf
103 | *.sdf
104 | *.cachefile
105 | *.VC.db
106 | *.VC.VC.opendb
107 |
108 | # Visual Studio profiler
109 | *.psess
110 | *.vsp
111 | *.vspx
112 | *.sap
113 |
114 | # Visual Studio Trace Files
115 | *.e2e
116 |
117 | # TFS 2012 Local Workspace
118 | $tf/
119 |
120 | # Guidance Automation Toolkit
121 | *.gpState
122 |
123 | # ReSharper is a .NET coding add-in
124 | _ReSharper*/
125 | *.[Rr]e[Ss]harper
126 | *.DotSettings.user
127 |
128 | # JustCode is a .NET coding add-in
129 | .JustCode
130 |
131 | # TeamCity is a build add-in
132 | _TeamCity*
133 |
134 | # DotCover is a Code Coverage Tool
135 | *.dotCover
136 |
137 | # AxoCover is a Code Coverage Tool
138 | .axoCover/*
139 | !.axoCover/settings.json
140 |
141 | # Visual Studio code coverage results
142 | *.coverage
143 | *.coveragexml
144 |
145 | # NCrunch
146 | _NCrunch_*
147 | .*crunch*.local.xml
148 | nCrunchTemp_*
149 |
150 | # MightyMoose
151 | *.mm.*
152 | AutoTest.Net/
153 |
154 | # Web workbench (sass)
155 | .sass-cache/
156 |
157 | # Installshield output folder
158 | [Ee]xpress/
159 |
160 | # DocProject is a documentation generator add-in
161 | DocProject/buildhelp/
162 | DocProject/Help/*.HxT
163 | DocProject/Help/*.HxC
164 | DocProject/Help/*.hhc
165 | DocProject/Help/*.hhk
166 | DocProject/Help/*.hhp
167 | DocProject/Help/Html2
168 | DocProject/Help/html
169 |
170 | # Click-Once directory
171 | publish/
172 |
173 | # Publish Web Output
174 | *.[Pp]ublish.xml
175 | *.azurePubxml
176 | # Note: Comment the next line if you want to checkin your web deploy settings,
177 | # but database connection strings (with potential passwords) will be unencrypted
178 | *.pubxml
179 | *.publishproj
180 |
181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
182 | # checkin your Azure Web App publish settings, but sensitive information contained
183 | # in these scripts will be unencrypted
184 | PublishScripts/
185 |
186 | # NuGet Packages
187 | *.nupkg
188 | # The packages folder can be ignored because of Package Restore
189 | **/[Pp]ackages/*
190 | # except build/, which is used as an MSBuild target.
191 | !**/[Pp]ackages/build/
192 | # Uncomment if necessary however generally it will be regenerated when needed
193 | #!**/[Pp]ackages/repositories.config
194 | # NuGet v3's project.json files produces more ignorable files
195 | *.nuget.props
196 | *.nuget.targets
197 |
198 | # Microsoft Azure Build Output
199 | csx/
200 | *.build.csdef
201 |
202 | # Microsoft Azure Emulator
203 | ecf/
204 | rcf/
205 |
206 | # Windows Store app package directories and files
207 | AppPackages/
208 | BundleArtifacts/
209 | Package.StoreAssociation.xml
210 | _pkginfo.txt
211 | *.appx
212 |
213 | # Visual Studio cache files
214 | # files ending in .cache can be ignored
215 | *.[Cc]ache
216 | # but keep track of directories ending in .cache
217 | !?*.[Cc]ache/
218 |
219 | # Others
220 | ClientBin/
221 | ~$*
222 | *~
223 | *.dbmdl
224 | *.dbproj.schemaview
225 | *.jfm
226 | *.pfx
227 | *.publishsettings
228 | orleans.codegen.cs
229 |
230 | # Including strong name files can present a security risk
231 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
232 | #*.snk
233 |
234 | # Since there are multiple workflows, uncomment next line to ignore bower_components
235 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
236 | #bower_components/
237 |
238 | # RIA/Silverlight projects
239 | Generated_Code/
240 |
241 | # Backup & report files from converting an old project file
242 | # to a newer Visual Studio version. Backup files are not needed,
243 | # because we have git ;-)
244 | _UpgradeReport_Files/
245 | Backup*/
246 | UpgradeLog*.XML
247 | UpgradeLog*.htm
248 | ServiceFabricBackup/
249 | *.rptproj.bak
250 |
251 | # SQL Server files
252 | *.mdf
253 | *.ldf
254 | *.ndf
255 |
256 | # Business Intelligence projects
257 | *.rdl.data
258 | *.bim.layout
259 | *.bim_*.settings
260 | *.rptproj.rsuser
261 | *- Backup*.rdl
262 |
263 | # Microsoft Fakes
264 | FakesAssemblies/
265 |
266 | # GhostDoc plugin setting file
267 | *.GhostDoc.xml
268 |
269 | # Node.js Tools for Visual Studio
270 | .ntvs_analysis.dat
271 | node_modules/
272 |
273 | # Visual Studio 6 build log
274 | *.plg
275 |
276 | # Visual Studio 6 workspace options file
277 | *.opt
278 |
279 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
280 | *.vbw
281 |
282 | # Visual Studio LightSwitch build output
283 | **/*.HTMLClient/GeneratedArtifacts
284 | **/*.DesktopClient/GeneratedArtifacts
285 | **/*.DesktopClient/ModelManifest.xml
286 | **/*.Server/GeneratedArtifacts
287 | **/*.Server/ModelManifest.xml
288 | _Pvt_Extensions
289 |
290 | # Paket dependency manager
291 | .paket/paket.exe
292 | paket-files/
293 |
294 | # FAKE - F# Make
295 | .fake/
296 |
297 | # JetBrains Rider
298 | .idea/
299 | *.sln.iml
300 |
301 | # CodeRush personal settings
302 | .cr/personal
303 |
304 | # Python Tools for Visual Studio (PTVS)
305 | __pycache__/
306 | *.pyc
307 |
308 | # Cake - Uncomment if you are using it
309 | # tools/**
310 | # !tools/packages.config
311 |
312 | # Tabs Studio
313 | *.tss
314 |
315 | # Telerik's JustMock configuration file
316 | *.jmconfig
317 |
318 | # BizTalk build output
319 | *.btp.cs
320 | *.btm.cs
321 | *.odx.cs
322 | *.xsd.cs
323 |
324 | # OpenCover UI analysis results
325 | OpenCover/
326 |
327 | # Azure Stream Analytics local run output
328 | ASALocalRun/
329 |
330 | # MSBuild Binary and Structured Log
331 | *.binlog
332 |
333 | # NVidia Nsight GPU debugger configuration file
334 | *.nvuser
335 |
336 | # MFractors (Xamarin productivity tool) working folder
337 | .mfractor/
338 |
339 | # Local History for Visual Studio
340 | .localhistory/
341 |
342 | # BeatPulse healthcheck temp database
343 | healthchecksdb
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TCS
2 |
3 | A slim cilent for Trojan-GFW.
4 |
5 | ## What's TCS?
6 |
7 | TCS(Trojan Client Slim) is a slim and easy client for Trojan-GFW.
8 |
9 | > TIPS: TCS only gives the most basic functions. If you need full-feature experience, please configure Trojan-GFW manually.
10 |
11 | ## What's supported?
12 |
13 | - Share link
14 | - Auto configure HTTP proxy
15 | - Auto save config
16 | - Auto generate trojan conf
17 | - GfWList mode to bypass GFW
18 | - GeoIP mode(Depends on Clash)
19 | - Node list *(Supported in 3.0.0)*
20 | - SNI settings *(Supported in 3.0.0)*
21 |
22 | ## TODO
23 |
24 | - Subscription auto update
25 | - Subscription list
26 |
27 | ## Screenshot(s)
28 |
29 | ### TCS 2.4.0
30 |
31 | 
32 |
33 | ### TCS 3.0.0 Preview 2
34 |
35 | 
36 |
37 | ## Chat
38 |
39 | Welcome to use Telegram to communicate with us. Our group link is
40 |
41 | ## Credit
42 |
43 | - [Trojan-GFW](https://github.com/trojan-gfw/trojan)
44 |
45 | ```credit
46 | Version: 1.14.1
47 | License: GPLv3
48 | ```
49 |
50 | - [Privoxy](https://www.privoxy.org/)
51 |
52 | ```credit
53 | Version: 3.0.28.0
54 | License: GPLv2
55 | ```
56 |
57 | - [Clash](https://github.com/Dreamacro/clash)
58 |
59 | ```credit
60 | Version: 0.18.0
61 | License: GPLv3
62 | ```
63 |
64 | ## Open-Sourced License - [GNU General Public License v3.0](LICENSE)
65 |
66 | ```license
67 | GNU GENERAL PUBLIC LICENSE
68 | Version 3, 29 June 2007
69 |
70 | Copyright (C) 2007 Free Software Foundation, Inc.
71 | Everyone is permitted to copy and distribute verbatim copies
72 | of this license document, but changing it is not allowed.
73 | ```
74 |
--------------------------------------------------------------------------------
/Screenshots/TCS00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/Screenshots/TCS00.png
--------------------------------------------------------------------------------
/Screenshots/TCS240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/Screenshots/TCS240.png
--------------------------------------------------------------------------------
/Screenshots/TCS300P2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/Screenshots/TCS300P2.png
--------------------------------------------------------------------------------
/TCS.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29201.188
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TCS", "TCS\TCS.csproj", "{2382F087-5972-4D2B-B4CF-0A0803CC893A}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0B3B576C-96DF-4524-862F-3B8FB7BF9230}"
9 | ProjectSection(SolutionItems) = preProject
10 | .editorconfig = .editorconfig
11 | EndProjectSection
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Release|Any CPU = Release|Any CPU
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {2382F087-5972-4D2B-B4CF-0A0803CC893A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {2382F087-5972-4D2B-B4CF-0A0803CC893A}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {2382F087-5972-4D2B-B4CF-0A0803CC893A}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {2382F087-5972-4D2B-B4CF-0A0803CC893A}.Release|Any CPU.Build.0 = Release|Any CPU
23 | EndGlobalSection
24 | GlobalSection(SolutionProperties) = preSolution
25 | HideSolutionNode = FALSE
26 | EndGlobalSection
27 | GlobalSection(ExtensibilityGlobals) = postSolution
28 | SolutionGuid = {27006DB3-B674-4E82-9FB9-227BB02BB86E}
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/TCS/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/TCS/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Reflection;
4 | using System.Runtime.InteropServices;
5 | using System.Windows.Forms;
6 |
7 | namespace TCS
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main(string[] args)
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Process instance = RunningInstance();
20 | if (instance == null)
21 | {
22 | Application.Run(new TCS(args));
23 | }
24 | else
25 | {
26 | Util.Message.Show("TCS is running.", Util.Message.Mode.Info);
27 | HandleRunningInstance(instance);
28 | }
29 |
30 | }
31 | public static Process RunningInstance()
32 | {
33 | Process current = Process.GetCurrentProcess();
34 | Process[] processes = Process.GetProcessesByName(current.ProcessName);
35 | foreach (Process process in processes)
36 | {
37 | if (process.Id != current.Id)
38 | {
39 | if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == current.MainModule.FileName)
40 | {
41 | return process;
42 | }
43 | }
44 | }
45 | return null;
46 | }
47 |
48 | public static void HandleRunningInstance(Process instance)
49 | {
50 | ShowWindow(instance.MainWindowHandle, WS_SHOWNORMAL);
51 | SetForegroundWindow(instance.MainWindowHandle);
52 | }
53 |
54 | [DllImport("User32.dll")]
55 | private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
56 |
57 | [DllImport("User32.dll")]
58 | private static extern bool SetForegroundWindow(IntPtr hWnd);
59 | private const int WS_SHOWNORMAL = 1;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/TCS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // 有关程序集的一般信息由以下
5 | // 控制。更改这些特性值可修改
6 | // 与程序集关联的信息。
7 | [assembly: AssemblyTitle("TCS")]
8 | [assembly: AssemblyDescription("A slim Trojan-GFW client for Windows users.")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Kevin Zonda")]
11 | [assembly: AssemblyProduct("Trojan Client Slim")]
12 | [assembly: AssemblyCopyright("Copyright © 2020 Kevin Zonda")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // 将 ComVisible 设置为 false 会使此程序集中的类型
17 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18 | //请将此类型的 ComVisible 特性设置为 true。
19 | [assembly: ComVisible(false)]
20 |
21 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22 | [assembly: Guid("2382f087-5972-4d2b-b4cf-0a0803cc893a")]
23 |
24 | // 程序集的版本信息由下列四个值组成:
25 | //
26 | // 主版本
27 | // 次版本
28 | // 生成号
29 | // 修订号
30 | //
31 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
32 | //通过使用 "*",如下所示:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("3.0.0.2")]
35 | [assembly: AssemblyFileVersion("3.0.0.2")]
36 |
--------------------------------------------------------------------------------
/TCS/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TCS.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TCS.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/TCS/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/TCS/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TCS.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/TCS/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/TCS/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
47 |
54 |
55 |
69 |
--------------------------------------------------------------------------------
/TCS/TCS.cs:
--------------------------------------------------------------------------------
1 | using IniParser;
2 |
3 | using System;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.Net;
7 | using System.Net.NetworkInformation;
8 | using System.Windows.Forms;
9 |
10 | using TCS.Util;
11 |
12 | using Message = TCS.Util.Message;
13 |
14 | namespace TCS
15 | {
16 | public partial class TCS : Form
17 | {
18 |
19 | readonly public static FileIniDataParser iniParser = new FileIniDataParser();
20 |
21 | #region Startup
22 |
23 | void InitialTemp()
24 | {
25 | try
26 | {
27 | Directory.Delete("temp", true);
28 | }
29 | catch { }
30 | finally
31 | {
32 | Directory.CreateDirectory("temp");
33 | }
34 | }
35 |
36 | public TCS(string[] args)
37 | {
38 | InitializeComponent();
39 | Config.tcs = this;
40 |
41 | InitialTemp();
42 |
43 | if (!Directory.Exists("db"))
44 | Directory.CreateDirectory("db");
45 |
46 | ReadConfig();
47 |
48 |
49 | if (File.Exists(TCSPath.Sni))
50 | {
51 | try
52 | {
53 | Config.sniList = new SniList(File.ReadAllLines(TCSPath.Sni));
54 | }
55 | catch
56 | {
57 | File.Create(TCSPath.Sni);
58 | }
59 | }
60 | else
61 | {
62 | File.Create(TCSPath.Sni);
63 | Config.sniList = new SniList();
64 | }
65 |
66 | //FIXME: node.tcs make failed? May cause problem!
67 | //if (File.Exists(TCSPath.Node))
68 | //{
69 | // string[] tmp = ShareLink.ConvertShareToTrojanConf(File.ReadAllText(TCSPath.Node));
70 | // if (!SetTrojanConf(File.ReadAllText(TCSPath.Node)))
71 | // File.Create(TCSPath.Node).Dispose();
72 | //}
73 | //else
74 | // File.Create(TCSPath.Node);
75 |
76 | this.SniBox.Text = Config.sniList[this.RemoteAddressBox.Text];
77 |
78 | if (Config.Debug)
79 | this.Text = "[D]" + this.Text;
80 |
81 | //TODO:NODELIST
82 | if (!File.Exists(TCSPath.NodeList))
83 | File.WriteAllText(TCSPath.NodeList, Config.DEFAULT_NODELIST_JSON);
84 | string a = string.Empty;
85 | try
86 | {
87 | a = Encrypt.DeBase64(File.ReadAllText(TCSPath.NodeList)).Trim();
88 | if (string.IsNullOrEmpty(a))
89 | throw new ArgumentException();
90 | Newtonsoft.Json.Linq.JObject.Parse(a);
91 | }
92 | catch (Exception ex)
93 | {
94 | Message.Show(ex.ToString());
95 | File.WriteAllText(TCSPath.Node, Config.DEFAULT_NODELIST_JSON);
96 | a = Encrypt.DeBase64(File.ReadAllText(TCSPath.NodeList)).Trim();
97 | }
98 | finally
99 | {
100 | NodeList.BindTreeView(NodeTree, a);
101 | }
102 |
103 | if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "TCS.lnk")))
104 | StartupToolStripMenuItem.Checked = true;
105 | else
106 | StartupToolStripMenuItem.Checked = false;
107 |
108 | if (args.Length == 1 && args[0].Trim().ToLower() == "silence")
109 | {
110 | //this.WindowState = FormWindowState.Minimized;
111 |
112 | RunTrojan(File.ReadAllText(TCSPath.Node), RunMode.Silence);
113 | notifyIcon.Visible = true;
114 | this.ShowInTaskbar = false;
115 | this.WindowState = FormWindowState.Minimized;
116 | }
117 |
118 | }
119 |
120 | private void TCS_Load(object sender, EventArgs e)
121 | {
122 |
123 | }
124 |
125 | private void ResetConfig()
126 | {
127 | if (File.Exists(Config.DEFAULT_CONFIG_PATH))
128 | {
129 | File.Delete(Config.DEFAULT_CONFIG_PATH);
130 | ResetConfig();
131 | }
132 | else
133 | {
134 | File.WriteAllText(Config.DEFAULT_CONFIG_PATH, Config.DEFAULT_CONFIG_INI);
135 | }
136 | }
137 |
138 | private void ReadConfig()
139 | {
140 | if (File.Exists(Config.DEFAULT_CONFIG_PATH))
141 | {
142 | //IniData Config.iniData;
143 | bool needWrite = false;
144 |
145 | //Exist
146 | try
147 | {
148 | iniParser.ReadFile(Config.DEFAULT_CONFIG_PATH);
149 | }
150 | catch
151 | {
152 | ResetConfig();
153 | }
154 | finally
155 | {
156 | Config.iniData = iniParser.ReadFile(Config.DEFAULT_CONFIG_PATH);
157 | }
158 |
159 |
160 |
161 | //proxtMode
162 | try
163 | {
164 | Config.proxyMode = Config.ProxyModeParser(Config.iniData["TCS"]["ProxyMode"]);
165 | }
166 | catch
167 | {
168 | needWrite = true;
169 | Config.iniData["TCS"]["ProxyMode"] = "GFWList";
170 | }
171 |
172 | //verifyCert
173 | try
174 | {
175 | Config.verifyCert = bool.Parse(Config.iniData["TCS"]["VerifyCert"]);
176 | }
177 | catch
178 | {
179 | needWrite = true;
180 | Config.iniData["TCS"]["VerifyCert"] = "true";
181 | }
182 |
183 | //verifyHostname
184 | try
185 | {
186 | Config.verifyHostname = bool.Parse(Config.iniData["TCS"]["VerifyHostname"]);
187 | }
188 | catch
189 | {
190 | needWrite = true;
191 | Config.iniData["TCS"]["VerifyHostname"] = "true";
192 | }
193 |
194 | //httpProxy
195 | try
196 | {
197 | Config.httpProxy = bool.Parse(Config.iniData["TCS"]["HttpProxy"]);
198 | }
199 | catch
200 | {
201 | needWrite = true;
202 | Config.iniData["TCS"]["HttpProxy"] = "true";
203 | }
204 |
205 | //localSocksPort
206 | try
207 | {
208 | Config.localSocksPort = int.Parse(Config.iniData["TCS"]["LocalSocksPort"]);
209 | }
210 | catch
211 | {
212 | Config.iniData["TCS"]["LocalSocksPort"] = Config.DEFAULT_SOCKS_PORT.ToString();
213 | needWrite = true;
214 | }
215 |
216 | //localHttpPort
217 | try
218 | {
219 | Config.localHttpPort = int.Parse(Config.iniData["TCS"]["LocalHttpPort"]);
220 | }
221 | catch
222 | {
223 | Config.iniData["TCS"]["LocalHttpPort"] = Config.DEFAULT_HTTP_PORT.ToString();
224 | needWrite = true;
225 | }
226 |
227 | try
228 | {
229 | if (bool.Parse(Config.iniData["TCS"]["Debug"]))
230 | Config.Debug = true;
231 | }
232 | catch { }
233 |
234 |
235 | if (needWrite)
236 | {
237 | iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
238 | ReadConfig();
239 | }
240 |
241 | }
242 | else
243 | {
244 | ResetConfig();
245 | ReadConfig();
246 | return;
247 | }
248 |
249 | }
250 | #endregion
251 |
252 | #region Button Click
253 | private void Run_Click(object sender, EventArgs e) => RunTrojan(ShareLinkBox.Text);
254 |
255 | private void Stop_Click(object sender, EventArgs e)
256 | {
257 | StopTrojan();
258 | InitialTemp();
259 | Message.Show("Stop Trojan succeeded!", Message.Mode.Info);
260 | }
261 |
262 | private void Cancle_Click(object sender, EventArgs e) => ExitTCS();
263 | #endregion
264 |
265 | #region Helper
266 | private void ExitTCS()
267 | {
268 | StopTrojan();
269 | try
270 | {
271 | Directory.Delete("temp", true);
272 | }
273 | catch
274 | {
275 |
276 | }
277 | System.Environment.Exit(0);
278 | }
279 |
280 | private void StopTrojan()
281 | {
282 | Command.StopProcess();
283 | try
284 | {
285 | Proxy.UnsetProxy();
286 | }
287 | catch
288 | {
289 | //FIXME: UNSET FAILED
290 | }
291 | }
292 |
293 | private enum RunMode
294 | {
295 | Silence, Normal
296 | }
297 |
298 | private void RunTrojan(string sharelink, RunMode mode = RunMode.Normal)
299 | {
300 | if (IsConfigValid(sharelink))
301 | {
302 | int status = 0;
303 |
304 | /* Status Code
305 | * 0 -> Normal
306 | * 1 -> LocalSocksPortUsed
307 | * 2 -> LocalHttpPortUsed
308 | * 3 -> LocalPortUsed
309 | * 4 -> ClashSocksUsed
310 | * 5 -> LocalClashSocksPortUsed
311 | */
312 |
313 | if (IsPortUsed(Config.localSocksPort))
314 | {
315 | status = 1;
316 | }
317 | if (IsPortUsed(Config.localHttpPort))
318 | {
319 | if (status == 0)
320 | {
321 | if (Config.httpProxy)
322 | status = 3;
323 | else
324 | status = 4;
325 | }
326 | else
327 | {
328 | if (Config.httpProxy)
329 | status = 2;
330 | else
331 | status = 5;
332 | }
333 | }
334 |
335 | string message = string.Empty;
336 | if (status != 0)
337 | {
338 | switch (status)
339 | {
340 | case 1:
341 | message = $"{Config.localSocksPort} is in use. Trojan may not work well.\r\n";
342 | break;
343 | case 2:
344 | message = $"{Config.localHttpPort} is in use. HTTP proxy may not work well.\r\n";
345 | break;
346 | case 3:
347 | message = $"{Config.localSocksPort} is in use.Trojan may not work well.\r\n" +
348 | $"{Config.localHttpPort} is in use. HTTP proxy may not work well.\r\n";
349 | break;
350 | case 4:
351 | message = $"{Config.localHttpPort} is in use. Clash may not work well.\r\n";
352 | break;
353 | case 5:
354 | message = $"{Config.localSocksPort} is in use.Trojan may not work well.\r\n" +
355 | $"{Config.localHttpPort} is in use. Clash may not work well.\r\n";
356 | break;
357 | }
358 | if (MessageBox.Show(message + "Do you still want to run?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
359 | {
360 | goto final;
361 | }
362 |
363 | }
364 |
365 | //TODO: Logs
366 | //if(!Directory.Exists("logs"))
367 | //{
368 | // Directory.CreateDirectory("logs");
369 | //}
370 | //File.CreateText("logs" + DateTime.Now.ToString(""))
371 |
372 | Command.StopProcess();
373 | InitialTemp();
374 | Command.RunTrojan();
375 | if (isHttp.Checked == true)
376 | {
377 | Command.RunHttpProxy();
378 | Proxy.SetProxy("127.0.0.1:" + Config.localHttpPort.ToString());
379 | }
380 | else
381 | {
382 | if (Config.proxyMode == Config.ProxyMode.Clash)
383 | {
384 | Command.RunSocksProxy();
385 | }
386 | }
387 | if (mode == RunMode.Normal)
388 | Message.Show("Start Trojan succeeded!", Message.Mode.Info);
389 | }
390 | else
391 | {
392 | Message.Show("Config invalid! Please enter current trojan information.", Message.Mode.Error);
393 | }
394 | final:;
395 | }
396 |
397 | private bool IsConfigValid(string sharelink)
398 | {
399 | if (ShareLink.ConvertShareToTrojanConf(sharelink) == null)
400 | return false;
401 | else
402 | return true;
403 | }
404 |
405 | private bool SetTrojanConf(string TcsShareLink) => SetTrojanConf((string[])ShareLink.ConvertShareToTrojanConf(TcsShareLink));
406 |
407 | private bool SetTrojanConf(string[] trojanConf)
408 | {
409 | if (trojanConf != null)
410 | {
411 | RemotePortBox.Text = trojanConf[1];
412 | RemoteAddressBox.Text = trojanConf[0];
413 | PasswordBox.Text = trojanConf[2];
414 | NodeNameBox.Text = trojanConf[3];
415 | return true;
416 | }
417 | RemotePortBox.Text = RemoteAddressBox.Text = PasswordBox.Text = NodeNameBox.Text = string.Empty;
418 | return false;
419 | }
420 |
421 | private void Conf2ShareLink() => ShareLinkBox.Text = ShareLink.Generate(RemoteAddressBox.Text, RemotePortBox.Text, PasswordBox.Text, NodeNameBox.Text);
422 |
423 | private static bool IsPortUsed(int port)
424 | {
425 | bool isPortUsed = false;
426 | IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
427 | IPEndPoint[] ipEndPoints = ipProperties.GetActiveTcpListeners();
428 | foreach (IPEndPoint endPoint in ipEndPoints)
429 | {
430 | if (endPoint.Port == port)
431 | {
432 | isPortUsed = true;
433 | break;
434 | }
435 | }
436 | return isPortUsed;
437 | }
438 | #endregion
439 |
440 | private void TCS_FormClosing(object sender, FormClosingEventArgs e)
441 | {
442 | try
443 | {
444 | Proxy.UnsetProxy();
445 | }
446 | catch
447 | { }
448 | Command.StopProcess();
449 | }
450 |
451 | #region Some Forms Widget
452 | private void GFWList_CheckedChanged(object sender, EventArgs e)
453 | {
454 | if (GFWList.Checked == true)
455 | Config.proxyMode = Config.ProxyMode.GFWList;
456 | }
457 |
458 | private void Global_CheckedChanged(object sender, EventArgs e)
459 | {
460 | if (Global.Checked == true)
461 | {
462 | Config.proxyMode = Config.ProxyMode.Full;
463 | if (!Config.httpProxy)
464 | {
465 | HttpPortBox.Enabled = false;
466 | }
467 | }
468 | }
469 |
470 | private void GeoIP_CheckedChanged(object sender, EventArgs e)
471 | {
472 | if (GeoIP.Checked)
473 | {
474 | Config.proxyMode = Config.ProxyMode.Clash;
475 | if (!Config.httpProxy)
476 | {
477 | HttpPortBox.Enabled = true;
478 | }
479 | }
480 | }
481 |
482 | private void ShowPassword_MouseHover(object sender, EventArgs e) => PasswordBox.PasswordChar = new char();
483 |
484 | private void ShowPassword_MouseLeave(object sender, EventArgs e) => PasswordBox.PasswordChar = '*';
485 |
486 | private void EnableShareLink_CheckedChanged(object sender, EventArgs e)
487 | {
488 | if (EnableShareLink.Checked)
489 | {
490 | ShareLinkBox.ReadOnly = false;
491 | }
492 | else
493 | {
494 | ShareLinkBox.ReadOnly = true;
495 | }
496 | }
497 | private void ShareLinkBox_MouseUp(object sender, MouseEventArgs e)
498 | {
499 | if (e.Button == MouseButtons.Left && !EnableShareLink.Checked)
500 | {
501 | ((TextBox)sender).SelectAll();
502 | }
503 | }
504 |
505 | char r = ' ';
506 | private new void KeyPress(object sender, KeyPressEventArgs e)
507 | {
508 | r = e.KeyChar;
509 | if (char.IsDigit(r) || r == 8)
510 | {
511 | e.Handled = false;
512 | }
513 | else
514 | {
515 | e.Handled = true;
516 | }
517 | }
518 | #endregion
519 |
520 | #region Size&NotifyIcon
521 |
522 | private void TCS_SizeChanged(object sender, EventArgs e)
523 | {
524 | if (WindowState == FormWindowState.Minimized)
525 | {
526 | this.ShowInTaskbar = false;
527 | notifyIcon.Visible = true;
528 | }
529 | }
530 |
531 | private void NotifyIcon_DoubleClick(object sender, EventArgs e)
532 | {
533 | if (WindowState == FormWindowState.Minimized)
534 | {
535 | WindowState = FormWindowState.Normal;
536 | this.Activate();
537 | this.ShowInTaskbar = true;
538 | notifyIcon.Visible = false;
539 | }
540 | }
541 |
542 | private void RunToolStripMenuItem_Click(object sender, EventArgs e) => RunTrojan(ShareLinkBox.Text);
543 |
544 | private void StopToolStripMenuItem_Click(object sender, EventArgs e) => StopTrojan();
545 |
546 | private void ExitToolStripMenuItem_Click(object sender, EventArgs e) => ExitTCS();
547 | private void ShareStripMenuItem_Click(object sender, EventArgs e)
548 | {
549 | Clipboard.SetText(ShareLinkBox.Text);
550 | Message.Show("TCS share link has copied to clipboard!", Message.Mode.Info);
551 | }
552 | private void ImportStripMenuItem_Click(object sender, EventArgs e)
553 | {
554 | IDataObject iData = Clipboard.GetDataObject();
555 | if (iData.GetDataPresent(DataFormats.Text))
556 | {
557 | string[] clipboardLines = ((string)iData.GetData(DataFormats.Text)).Split(new string[] { "\n" }, StringSplitOptions.None);
558 | foreach (string clipboardLine in clipboardLines)
559 | {
560 | bool hasDefaultNode = false;
561 | int defaultIndex = 0;
562 | for (int i = 0; i < NodeTree.Nodes.Count; i++)
563 | {
564 | if (NodeTree.Nodes[i].Text == "Default")
565 | {
566 | hasDefaultNode = true;
567 | defaultIndex = i;
568 | }
569 | }
570 | if (!hasDefaultNode)
571 | {
572 | NodeTree.Nodes.Add(new TreeNode { Text = "Default" });
573 | defaultIndex = NodeTree.Nodes.Count - 1;
574 | }
575 | if (ShareLink.ConvertShareToTrojanConf(clipboardLine) != null)
576 | {
577 | string v = "Untitled";
578 | if (clipboardLine.Split('#').Length == 2)
579 | v = clipboardLine.Split('#')[1];
580 | NodeTree.Nodes[defaultIndex].Nodes.Add(new TreeNode { Text = v, Tag = clipboardLine });
581 | if (WindowState == FormWindowState.Minimized)
582 | {
583 | WindowState = FormWindowState.Normal;
584 | this.Activate();
585 | this.ShowInTaskbar = true;
586 | notifyIcon.Visible = false;
587 | }
588 | }
589 | }
590 | }
591 | }
592 |
593 | #endregion
594 |
595 | #region TextChanged
596 | private void RemoteAddressBox_TextChanged(object sender, EventArgs e)
597 | {
598 | SniBox.Text = Config.sniList[RemoteAddressBox.Text];
599 |
600 | if (!string.IsNullOrWhiteSpace(RemoteAddressBox.Text))
601 | Conf2ShareLink();
602 | }
603 |
604 | private void NodeNameBox_TextChanged(object sender, EventArgs e)
605 | {
606 | if (NodeTree.SelectedNode != null)
607 | {
608 | NodeTree.SelectedNode.Text = NodeNameBox.Text;
609 | if (NodeTree.SelectedNode.Level == 0)
610 | {
611 | ShareLinkBox.TextChanged -= ShareLinkBox_TextChanged;
612 | bool Has = false;
613 | int inx = 0;
614 | for (int i = 0; i < NodeTree.Nodes.Count; i++)
615 | {
616 | if (NodeTree.Nodes[i].Text == NodeNameBox.Text)
617 | {
618 | ++inx;
619 | if (inx == 2)
620 | {
621 | Has = true;
622 | break;
623 | }
624 | }
625 | }
626 | if (Has)
627 | {
628 | Message.Show("Please set different group name!");
629 | NodeTree.Enabled = false;
630 | }
631 | else
632 | {
633 | NodeTree.Enabled = true;
634 | File.WriteAllText(TCSPath.NodeList, NodeTree.ToJObject().ToString());
635 | ShareLinkBox.TextChanged += ShareLinkBox_TextChanged;
636 |
637 | }
638 | }
639 | else
640 | File.WriteAllText(TCSPath.NodeList, NodeTree.ToJObject().ToString());
641 |
642 | }
643 | NodeNameBox.Text = NodeNameBox.Text.Replace("#", "");
644 | if (!string.IsNullOrWhiteSpace(NodeNameBox.Text))
645 | Conf2ShareLink();
646 | }
647 |
648 | private string lastRP = "443";
649 | private void RemotePortBox_TextChanged(object sender, EventArgs e)
650 | {
651 | if (!string.IsNullOrWhiteSpace(RemotePortBox.Text))
652 | {
653 | Conf2ShareLink();
654 | //int i = int.Parse(RemotePortBox.Text.Trim());
655 | /*if (i >= 1 && i <= 65535)
656 | lastRP = RemotePortBox.Text;
657 | else
658 | {
659 | Message.Show("Range of port is 1-65535!", Message.Mode.Error);
660 | RemotePortBox.Text = lastRP;
661 | }
662 | */
663 | }
664 | }
665 |
666 |
667 | private void PasswordBox_TextChanged(object sender, EventArgs e) => Conf2ShareLink();
668 |
669 | private void ShareLinkBox_TextChanged(object sender, EventArgs e)
670 | {
671 | QrCodeBox.Text = ShareLinkBox.Text;
672 | SetTrojanConf(ShareLinkBox.Text);
673 | try
674 | {
675 | File.WriteAllText(TCSPath.Node,
676 | ShareLink.Generate(RemoteAddressBox.Text, RemotePortBox.Text, PasswordBox.Text, NodeNameBox.Text));
677 | if (NodeTree.SelectedNode != null)
678 | if (NodeTree.SelectedNode.Level != 0)
679 | NodeTree.SelectedNode.Tag = ShareLinkBox.Text;
680 | }
681 | catch
682 | {
683 | Message.Show("Node written failed!", Message.Mode.Error);
684 | }
685 |
686 | File.WriteAllText(TCSPath.NodeList, Encrypt.Base64(NodeTree.ToJObject().ToString()));
687 | }
688 |
689 | private void SocksPortBox_TextChanged(object sender, EventArgs e)
690 | {
691 | try
692 | {
693 | Config.localSocksPort = int.Parse(SocksPortBox.Text);
694 | }
695 | catch
696 | {
697 | Message.Show("Port can only be an integer", Message.Mode.Error);
698 | }
699 | }
700 |
701 | private void HttpPortBox_TextChanged(object sender, EventArgs e)
702 | {
703 | try
704 | {
705 | Config.localHttpPort = int.Parse(HttpPortBox.Text);
706 | }
707 | catch
708 | {
709 | Message.Show("Port can only be an integer", Message.Mode.Error);
710 | }
711 | }
712 |
713 | private void SniBox_TextChanged(object sender, EventArgs e)
714 | {
715 | if (string.IsNullOrWhiteSpace(SniBox.Text))
716 | Config.sniList.Remove(Config.remoteAddress);
717 | else
718 | if (!string.IsNullOrWhiteSpace(RemoteAddressBox.Text))
719 | Config.sniList[RemoteAddressBox.Text] = SniBox.Text;
720 | File.WriteAllLines(TCSPath.Sni, Config.sniList.ToArray());
721 | }
722 | #endregion
723 |
724 | #region CheckedChanged
725 | private void IsVerifyCert_CheckedChanged(object sender, EventArgs e) => Config.verifyCert = isVerifyCert.Checked;
726 |
727 | private void IsVerifyHostname_CheckedChanged(object sender, EventArgs e) => Config.verifyHostname = isVerifyHostname.Checked;
728 |
729 | private void IsHttp_CheckedChanged(object sender, EventArgs e)
730 | {
731 | Config.httpProxy = isHttp.Checked;
732 | if (Config.httpProxy)
733 | {
734 | httpPortLabel.Text = "HTTP Port:";
735 | HttpPortBox.Enabled = true;
736 | GFWList.Enabled = true;
737 | }
738 | else
739 | {
740 | httpPortLabel.Text = "Socks Port:";
741 | //HttpPortBox.Enabled = false;
742 | GFWList.Enabled = false;
743 | if (GFWList.Checked)
744 | GeoIP.Checked = true;
745 | if (Global.Checked)
746 | HttpPortBox.Enabled = false;
747 | }
748 | }
749 | #endregion
750 |
751 | private void StartupToolStripMenuItem_Click(object sender, EventArgs e)
752 | {
753 | if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "TCS.lnk")))
754 | {
755 | LnkHelper.RemoveLnk();
756 | StartupToolStripMenuItem.Checked = false;
757 | }
758 | else
759 | {
760 | LnkHelper.SetLnk();
761 | StartupToolStripMenuItem.Checked = true;
762 | }
763 | }
764 |
765 | private void AboutStripMenuItem_Click(object sender, EventArgs e)
766 | {
767 | Message.Show(
768 | "[Trojan]\r\n" +
769 | "Ahthor: trojan-gfw contributors\r\n" +
770 | "[Clash]\r\n" +
771 | "Author: Dreamacro and other contributors\r\n" +
772 | "[TCS]\r\n" +
773 | "Author: KevinZonda and other contributors\r\n", Message.Mode.Info);
774 | }
775 |
776 |
777 |
778 | private void AddNode_Click(object sender, EventArgs e)
779 | {
780 | TreeNode tn = new TreeNode()
781 | {
782 | Text = "Default",
783 | Tag = "trojan://HelloWorld@google.com:443#Default"
784 | };
785 |
786 | if (NodeTree.SelectedNode != null)
787 | {
788 | if (NodeTree.SelectedNode.Level == 0)
789 | {
790 | NodeTree.SelectedNode.Nodes.Add(tn);
791 | NodeTree.SelectedNode = NodeTree.SelectedNode.Nodes[NodeTree.SelectedNode.Nodes.Count - 1];
792 | }
793 | else
794 | {
795 | NodeTree.SelectedNode.Parent.Nodes.Add(tn);
796 | NodeTree.SelectedNode = NodeTree.SelectedNode.Parent.Nodes[NodeTree.SelectedNode.Parent.Nodes.Count - 1];
797 | }
798 |
799 | }
800 | }
801 |
802 | private void DeleteNode_Click(object sender, EventArgs e)
803 | {
804 | int v = NodeTree.SelectedNode.Index;
805 | TreeNode tv;
806 | bool isRoot = false;
807 | if (NodeTree.SelectedNode.Level == 0)
808 | {
809 | isRoot = true;
810 | tv = NodeTree.SelectedNode;
811 | if (MessageBox.Show("Do you want to remove this group?", "Info",
812 | MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
813 | goto final;
814 | }
815 | else
816 | tv = NodeTree.SelectedNode.Parent;
817 |
818 | NodeTree.SelectedNode.Remove();
819 |
820 | if (v == tv.Nodes.Count)
821 | v -= 1;
822 | if (v > 0 && !isRoot)
823 | NodeTree.SelectedNode = tv.Nodes[v];
824 |
825 | final:;
826 | }
827 |
828 | private TreeNode previousSelectedNode;
829 | private void NodeTree_Validated(object sender, EventArgs e)
830 | {
831 |
832 | if (NodeTree.SelectedNode != null)
833 | {
834 | NodeTree.SelectedNode.BackColor = SystemColors.Highlight;
835 | NodeTree.SelectedNode.ForeColor = Color.White;
836 | previousSelectedNode = NodeTree.SelectedNode;
837 | }
838 | }
839 |
840 | private void NodeTree_AfterSelect(object sender, TreeViewEventArgs e)
841 | {
842 | if (previousSelectedNode != null)
843 | {
844 | previousSelectedNode.BackColor = NodeTree.BackColor;
845 | previousSelectedNode.ForeColor = NodeTree.ForeColor;
846 | }
847 |
848 | if (NodeTree.SelectedNode.Level != 0)
849 | {
850 | if (NodeTree.SelectedNode.Tag != null)
851 | {
852 | string v = NodeTree.SelectedNode.Tag.ToString();
853 | ShareLinkBox.Text = v;
854 | }
855 | }
856 | else
857 | {
858 | RemoteAddressBox.Text = PasswordBox.Text = string.Empty;
859 | NodeNameBox.Text = NodeTree.SelectedNode.Text;
860 | RemotePortBox.Text = "0";
861 | }
862 | }
863 |
864 | private void AddGroup_Click(object sender, EventArgs e)
865 | {
866 | NodeTree.Nodes.Add(GetRandomString(8));
867 | }
868 |
869 | public static string GetRandomString(int length)
870 | {
871 | byte[] b = new byte[4];
872 | new System.Security.Cryptography.RNGCryptoServiceProvider().GetBytes(b);
873 | Random r = new Random(BitConverter.ToInt32(b, 0));
874 | string s = null, str = "";
875 | str += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
876 | for (int i = 0; i < length; i++)
877 | {
878 | s += str.Substring(r.Next(0, str.Length - 1), 1);
879 | }
880 | return s;
881 | }
882 |
883 | private void Subscription_Click(object sender, EventArgs e)
884 | {
885 | UrlNode u = new UrlNode(NodeTree);
886 | u.ShowDialog();
887 | //Message.Show("Undeveloped Module");
888 | }
889 | }
890 | }
--------------------------------------------------------------------------------
/TCS/TCS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {2382F087-5972-4D2B-B4CF-0A0803CC893A}
8 | WinExe
9 | TCS
10 | TCS
11 | v4.5
12 | 512
13 | true
14 | false
15 |
16 |
17 | publish\
18 | true
19 | Disk
20 | false
21 | Foreground
22 | 7
23 | Days
24 | false
25 | false
26 | true
27 | https://github.com/KevinZonda/trojan-client-slim
28 | https://github.com/KevinZonda/trojan-client-slim/issues
29 | TCS
30 | Kevin Zonda
31 | TCS
32 | false
33 | true
34 | 0
35 | 2.3.0.0
36 | false
37 | true
38 | true
39 | true
40 |
41 |
42 | AnyCPU
43 | true
44 | full
45 | false
46 | bin\Debug\
47 | DEBUG;TRACE
48 | prompt
49 | 4
50 | false
51 |
52 |
53 | AnyCPU
54 | none
55 | true
56 | bin\Release\
57 |
58 |
59 | prompt
60 | 4
61 | false
62 |
63 |
64 | logo.ico
65 |
66 |
67 | 30103D6BB79E6999659C0DC27656B8F6469FE3C4
68 |
69 |
70 | TrojanClientSlim_TemporaryKey.pfx
71 |
72 |
73 | false
74 |
75 |
76 | false
77 |
78 |
79 | false
80 |
81 |
82 | LocalIntranet
83 |
84 |
85 | Properties\app.manifest
86 |
87 |
88 |
89 | ..\packages\QrCode.Net.0.4.0.0\lib\net45\Gma.QrCodeNet.Encoding.dll
90 |
91 |
92 | ..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll
93 |
94 |
95 | ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | Form
113 |
114 |
115 | UrlNode.cs
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | Form
128 |
129 |
130 | TCS.cs
131 |
132 |
133 |
134 |
135 |
136 |
137 | TCS.cs
138 |
139 |
140 | ResXFileCodeGenerator
141 | Resources.Designer.cs
142 | Designer
143 |
144 |
145 | True
146 | Resources.resx
147 | True
148 |
149 |
150 | UrlNode.cs
151 |
152 |
153 | .editorconfig
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | SettingsSingleFileGenerator
162 | Settings.Designer.cs
163 |
164 |
165 | True
166 | Settings.settings
167 | True
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 | False
185 | .NET Framework 3.5 SP1
186 | false
187 |
188 |
189 |
190 |
191 | False
192 |
193 |
194 |
195 |
196 | Include
197 | True
198 | Assembly
199 |
200 |
201 | False
202 |
203 |
204 |
205 |
206 | Include
207 | True
208 | File
209 |
210 |
211 | False
212 |
213 |
214 |
215 |
216 | Include
217 | True
218 | File
219 |
220 |
221 | False
222 |
223 |
224 |
225 |
226 | Include
227 | True
228 | File
229 |
230 |
231 | False
232 |
233 |
234 |
235 |
236 | Include
237 | True
238 | File
239 |
240 |
241 | False
242 |
243 |
244 |
245 |
246 | Include
247 | True
248 | File
249 |
250 |
251 |
252 |
253 | {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}
254 | 1
255 | 0
256 | 0
257 | tlbimp
258 | False
259 | True
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 | ::rmdir /s/q clash
270 | ::rmdir /s/q trojan
271 | ::rmdir /s/q privoxy
272 | ::mkdir clash
273 | ::mkdir trojan
274 | ::mkdir privoxy
275 | ::xcopy $(ProjectDir)clash clash
276 | ::xcopy $(ProjectDir)trojan trojan
277 | ::xcopy $(ProjectDir)privoxy privoxy
278 |
279 |
280 |
--------------------------------------------------------------------------------
/TCS/UrlNode.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace TCS
2 | {
3 | partial class UrlNode
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.UrlBox = new System.Windows.Forms.TextBox();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.ContentBox = new System.Windows.Forms.TextBox();
34 | this.OK = new System.Windows.Forms.Button();
35 | this.Get = new System.Windows.Forms.Button();
36 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
37 | this.tableLayoutPanel1.SuspendLayout();
38 | this.SuspendLayout();
39 | //
40 | // UrlBox
41 | //
42 | this.UrlBox.Location = new System.Drawing.Point(47, 12);
43 | this.UrlBox.Name = "UrlBox";
44 | this.UrlBox.Size = new System.Drawing.Size(382, 21);
45 | this.UrlBox.TabIndex = 0;
46 | //
47 | // label1
48 | //
49 | this.label1.AutoSize = true;
50 | this.label1.Location = new System.Drawing.Point(12, 15);
51 | this.label1.Name = "label1";
52 | this.label1.Size = new System.Drawing.Size(29, 12);
53 | this.label1.TabIndex = 1;
54 | this.label1.Text = "URL:";
55 | //
56 | // ContentBox
57 | //
58 | this.ContentBox.Location = new System.Drawing.Point(14, 46);
59 | this.ContentBox.Multiline = true;
60 | this.ContentBox.Name = "ContentBox";
61 | this.ContentBox.Size = new System.Drawing.Size(415, 227);
62 | this.ContentBox.TabIndex = 2;
63 | //
64 | // OK
65 | //
66 | this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
67 | | System.Windows.Forms.AnchorStyles.Left)
68 | | System.Windows.Forms.AnchorStyles.Right)));
69 | this.OK.Location = new System.Drawing.Point(210, 3);
70 | this.OK.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
71 | this.OK.Name = "OK";
72 | this.OK.Size = new System.Drawing.Size(205, 50);
73 | this.OK.TabIndex = 3;
74 | this.OK.Text = "Import";
75 | this.OK.UseVisualStyleBackColor = true;
76 | this.OK.Click += new System.EventHandler(this.OK_Click);
77 | //
78 | // Get
79 | //
80 | this.Get.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
81 | | System.Windows.Forms.AnchorStyles.Left)
82 | | System.Windows.Forms.AnchorStyles.Right)));
83 | this.Get.Location = new System.Drawing.Point(0, 3);
84 | this.Get.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
85 | this.Get.Name = "Get";
86 | this.Get.Size = new System.Drawing.Size(204, 50);
87 | this.Get.TabIndex = 4;
88 | this.Get.Text = "GET";
89 | this.Get.UseVisualStyleBackColor = true;
90 | this.Get.Click += new System.EventHandler(this.Get_Click);
91 | //
92 | // tableLayoutPanel1
93 | //
94 | this.tableLayoutPanel1.ColumnCount = 2;
95 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
96 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
97 | this.tableLayoutPanel1.Controls.Add(this.OK, 1, 0);
98 | this.tableLayoutPanel1.Controls.Add(this.Get, 0, 0);
99 | this.tableLayoutPanel1.Location = new System.Drawing.Point(14, 279);
100 | this.tableLayoutPanel1.Name = "tableLayoutPanel1";
101 | this.tableLayoutPanel1.RowCount = 1;
102 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
103 | this.tableLayoutPanel1.Size = new System.Drawing.Size(415, 56);
104 | this.tableLayoutPanel1.TabIndex = 5;
105 | //
106 | // UrlNode
107 | //
108 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
109 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
110 | this.BackColor = System.Drawing.SystemColors.Window;
111 | this.ClientSize = new System.Drawing.Size(440, 342);
112 | this.Controls.Add(this.tableLayoutPanel1);
113 | this.Controls.Add(this.ContentBox);
114 | this.Controls.Add(this.label1);
115 | this.Controls.Add(this.UrlBox);
116 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
117 | this.MaximizeBox = false;
118 | this.MinimizeBox = false;
119 | this.Name = "UrlNode";
120 | this.Text = "UrlNode";
121 | this.tableLayoutPanel1.ResumeLayout(false);
122 | this.ResumeLayout(false);
123 | this.PerformLayout();
124 |
125 | }
126 |
127 | #endregion
128 |
129 | private System.Windows.Forms.TextBox UrlBox;
130 | private System.Windows.Forms.Label label1;
131 | private System.Windows.Forms.TextBox ContentBox;
132 | private System.Windows.Forms.Button OK;
133 | private System.Windows.Forms.Button Get;
134 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
135 | }
136 | }
--------------------------------------------------------------------------------
/TCS/UrlNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Text.RegularExpressions;
4 | using System.Windows.Forms;
5 |
6 | using TCS.Util;
7 |
8 | using Message = TCS.Util.Message;
9 |
10 | namespace TCS
11 | {
12 | public partial class UrlNode : Form
13 | {
14 |
15 | TreeView tv;
16 | public UrlNode(TreeView tv)
17 | {
18 | InitializeComponent();
19 | this.tv = tv;
20 | }
21 |
22 | private string _getContent = null;
23 | private string _decryptContent = null;
24 | private void OK_Click(object sender, EventArgs e)
25 | {
26 | if (string.IsNullOrWhiteSpace(ContentBox.Text))
27 | {
28 | _getContent = ContentBox.Text = Http.GET(UrlBox.Text);
29 | }
30 | else
31 | {
32 | _getContent = ContentBox.Text;
33 | }
34 | try
35 | {
36 | string[] b = Regex.Split(Encrypt.DeBase64(_getContent, true), "\n");
37 | if (MessageBox.Show(
38 | $"[Summary]\r\n" +
39 | $"Group: ${Encrypt.SHA1(ContentBox.Text)}\r\n" +
40 | $"Count: {b.Length}\r\n" +
41 | $"Your operation may overwrite the original data. Do you want to continue?",
42 | "Info", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
43 | {
44 | string n = Encrypt.SHA1(UrlBox.Text);
45 | for (int i = 0; i < tv.Nodes.Count; i++)
46 | {
47 | if (tv.Nodes[i].Text == n)
48 | {
49 | tv.Nodes[i].Remove();
50 | break;
51 | }
52 | }
53 |
54 | tv.Nodes.Add(new TreeNode()
55 | {
56 | Text = n
57 | });
58 |
59 | foreach (var v in b)
60 | {
61 | if (!string.IsNullOrWhiteSpace(v))
62 | {
63 | //Regex.Replace(v, @"\p{Cs}", "")
64 | string[] bb = v.Split('#');
65 | TreeNode vv = new TreeNode();
66 | if (bb.Length == 2)
67 | vv.Text = bb[1];
68 | else
69 | vv.Text = "Untitled";
70 | vv.Tag = v;
71 | tv.Nodes[tv.Nodes.Count - 1].Nodes.Add(vv);
72 | }
73 | }
74 | }
75 | File.WriteAllText(TCSPath.NodeList, Encrypt.Base64(tv.ToJObject().ToString()));
76 | }
77 | catch (IOException)
78 | {
79 | Message.Show("File written failed!", Message.Mode.Error);
80 | }
81 | catch (FormatException)
82 | {
83 | Message.Show("Input is invalid", Message.Mode.Error);
84 | }
85 | catch (Exception)
86 | {
87 |
88 | }
89 | }
90 |
91 | private void Get_Click(object sender, EventArgs e)
92 | {
93 | _getContent = ContentBox.Text = Http.GET(UrlBox.Text);
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/TCS/UrlNode.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/TCS/Util/Command.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json.Linq;
2 |
3 | using System.Diagnostics;
4 | using System.IO;
5 |
6 | namespace TCS.Util
7 | {
8 | class Command
9 | {
10 |
11 | /*
12 | * CLASH
13 | * {CLASH_SOCKS_LISTEN}
14 | * {CLASH_HTTP_LISTEN}
15 | *
16 | * TROJAN
17 | * {TROJAN_SOCKS_LISTEN}
18 | *
19 | * PRIVOXY
20 | * {PRIVOXY_HTTP_LISTEN}
21 | *
22 | */
23 |
24 | public static void RunTrojan()
25 | {
26 | File.Copy(@"trojan\config.json", @"temp\trojan.json", true);
27 | string trojanJson = File.ReadAllText(@"temp\trojan.json")
28 | .Replace("\"{VERIFY_CERT}\"", Config.verifyCert.ToString().ToLower())
29 | .Replace("\"{VERIFY_HOSTNAME}\"", Config.verifyHostname.ToString().ToLower())
30 | .Replace("{SNI}", Config.sniList[Config.remoteAddress]);
31 |
32 | JObject jo = JObject.Parse(trojanJson);
33 |
34 | jo["local_port"] = Config.localSocksPort;
35 | jo["remote_addr"] = Config.remoteAddress;
36 | jo["remote_port"] = Config.remotePort;
37 |
38 | JArray ja = new JArray
39 | {
40 | Config.password
41 | };
42 | jo["password"] = ja;
43 |
44 | File.WriteAllText(@"temp\trojan.json", jo.ToString());
45 |
46 | Process p = new Process();
47 | p.StartInfo.FileName = @"trojan\trojan.exe";
48 | p.StartInfo.Arguments = @"-c temp\trojan.json";
49 | if (Config.Debug)
50 | p.StartInfo.UseShellExecute = true;
51 | else
52 | {
53 | p.StartInfo.UseShellExecute = false;
54 | p.StartInfo.CreateNoWindow = true;
55 | }
56 | p.Start();
57 | }
58 |
59 | private static string tmp;
60 | public static void RunHttpProxy()
61 | {
62 | //string tmp = "";
63 |
64 | Process p = new Process();
65 | p.StartInfo.FileName = "cmd.exe";
66 | //pc.StartInfo.Arguments = $"start {path}\\privoxy\\privoxy.exe {path}\\privoxy\\config.txt";
67 | switch (Config.proxyMode)
68 | {
69 | case Config.ProxyMode.Full:
70 | File.Copy(@"privoxy\config.txt", @"temp\config.txt");
71 | Command.tmp = File.ReadAllText(@"temp\config.txt")
72 | .Replace("{TROJAN_SOCKS_LISTEN}", Config.localSocksPort.ToString())
73 | .Replace("{PRIVOXY_HTTP_LISTEN}", Config.localHttpPort.ToString());
74 |
75 | File.WriteAllText(@"temp\config.txt", Command.tmp);
76 |
77 | p.StartInfo.Arguments = @"/c START /MIN privoxy\privoxy.exe temp\config.txt";
78 |
79 | p.StartInfo.UseShellExecute = false;
80 | p.StartInfo.CreateNoWindow = true;
81 | break;
82 |
83 | case Config.ProxyMode.GFWList:
84 | File.Copy(@"privoxy\config_gfw.txt", @"temp\config.txt");
85 | File.Copy(@"privoxy\gfwlist.action", @"temp\gfwlist.action");
86 |
87 | Command.tmp = File.ReadAllText(@"temp\config.txt")
88 | .Replace("{PRIVOXY_HTTP_LISTEN}", Config.localHttpPort.ToString());
89 |
90 | File.WriteAllText(@"temp\config.txt", Command.tmp);
91 |
92 | Command.tmp = File.ReadAllText(@"temp\gfwlist.action")
93 | .Replace("{TROJAN_SOCKS_LISTEN}", Config.localSocksPort.ToString());
94 |
95 | File.WriteAllText(@"temp\gfwlist.action", Command.tmp);
96 | p.StartInfo.Arguments = @"/c START /MIN privoxy\privoxy.exe temp\config.txt";
97 |
98 |
99 | p.StartInfo.UseShellExecute = false;
100 | p.StartInfo.CreateNoWindow = true;
101 | break;
102 | case Config.ProxyMode.Clash:
103 | File.Copy(@"clash\config.yaml", @"temp\config.yaml", true);
104 | File.Copy(@"clash\Country.mmdb", @"temp\Country.mmdb", true);
105 |
106 | Command.tmp = File.ReadAllText(@"temp\config.yaml")
107 | .Replace("{TROJAN_SOCKS_LISTEN}", Config.localSocksPort.ToString())
108 | .Replace("{CLASH_HTTP_LISTEN}", Config.localHttpPort.ToString())
109 | .Replace("{CLASH_SOCKS_LISTEN}", 0.ToString());
110 |
111 | File.WriteAllText(@"temp\config.yaml", Command.tmp);
112 |
113 | p.StartInfo.FileName = @"clash\clash.exe";
114 | p.StartInfo.Arguments = @"-d temp";
115 | if (Config.Debug)
116 | p.StartInfo.UseShellExecute = true;
117 | else
118 | {
119 | p.StartInfo.UseShellExecute = false;
120 | p.StartInfo.CreateNoWindow = true;
121 | }
122 | break;
123 | }
124 | p.Start();
125 | //p.Dispose();
126 | }
127 |
128 | public static void RunSocksProxy()
129 | {
130 | Process p = new Process();
131 | p.StartInfo.FileName = "cmd.exe";
132 |
133 | File.Copy(@"clash\config.yaml", @"temp\config.yaml", true);
134 | File.Copy(@"clash\Country.mmdb", @"temp\Country.mmdb", true);
135 |
136 | Command.tmp = File.ReadAllText(@"temp\config.yaml")
137 | .Replace("{TROJAN_SOCKS_LISTEN}", Config.localSocksPort.ToString())
138 | .Replace("{CLASH_HTTP_LISTEN}", 0.ToString())
139 | .Replace("{CLASH_SOCKS_LISTEN}", Config.localHttpPort.ToString());
140 |
141 | File.WriteAllText(@"temp\config.yaml", Command.tmp);
142 |
143 | p.StartInfo.FileName = @"clash\clash.exe";
144 | p.StartInfo.Arguments = @"-d temp";
145 | if (Config.Debug)
146 | p.StartInfo.UseShellExecute = true;
147 | else
148 | {
149 | p.StartInfo.UseShellExecute = false;
150 | p.StartInfo.CreateNoWindow = true;
151 | }
152 |
153 | p.Start();
154 |
155 | }
156 |
157 | public static void StopProcess()
158 | {
159 |
160 | Process[] myproc = Process.GetProcesses();
161 | foreach (Process item in myproc)
162 | {
163 | if (item.ProcessName.ToLower() == "trojan" ||
164 | item.ProcessName.ToLower() == "privoxy" ||
165 | item.ProcessName.ToLower() == "clash")
166 | {
167 | item.Kill();
168 | }
169 | }
170 | }
171 |
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/TCS/Util/Config.cs:
--------------------------------------------------------------------------------
1 | using IniParser.Model;
2 |
3 | namespace TCS.Util
4 | {
5 | public static class Config
6 | {
7 | public static IniData iniData;
8 |
9 | public static TCS tcs;
10 |
11 | public static bool Debug = false;
12 | public enum ProxyMode
13 | {
14 | Full = 0,
15 | GFWList = 1,
16 | Clash = 2
17 | }
18 |
19 | public static ProxyMode ProxyModeParser(string proxyMode)
20 | {
21 | if (proxyMode is null) return ProxyMode.Full;
22 | switch (proxyMode.ToLower())
23 | {
24 | default:
25 | case "full":
26 | return ProxyMode.Full;
27 | case "gfwlist":
28 | return ProxyMode.GFWList;
29 | case "clash":
30 | return ProxyMode.Clash;
31 | }
32 |
33 | }
34 |
35 | public static string ProxyMode2String(ProxyMode pm)
36 | {
37 | switch (pm)
38 | {
39 | case ProxyMode.Clash:
40 | return "clash";
41 | case ProxyMode.Full:
42 | return "full";
43 | case ProxyMode.GFWList:
44 | return "gfwlist";
45 | default:
46 | throw new System.ArgumentException("Not a valid ProxyMode");
47 | }
48 | }
49 |
50 |
51 | public const int DEFAULT_SOCKS_PORT = 1080;
52 | //public const int DEFAULT_CLASH_SOCKS_LISTEN = 67362;
53 | public const int DEFAULT_HTTP_PORT = 7263;
54 | public const bool DEFAULT_VERIFY_CERT = true;
55 | public const bool DEFAULT_HTTP_PROXY = true;
56 | public const bool DEFAULT_VERIFY_HOSTNAME = true;
57 | public const ProxyMode DEFAULT_PROXY = ProxyMode.GFWList;
58 |
59 |
60 | public static ProxyMode proxyMode
61 | {
62 | set
63 | {
64 | //Debug.WriteLine(value.ToString());
65 | switch (value)
66 | {
67 | case ProxyMode.GFWList:
68 | tcs.GFWList.Checked = true;
69 | tcs.Global.Checked = tcs.GeoIP.Checked = false;
70 | break;
71 | case ProxyMode.Full:
72 | tcs.Global.Checked = true;
73 | tcs.GFWList.Checked = tcs.GeoIP.Checked = false;
74 | break;
75 | case ProxyMode.Clash:
76 | tcs.GeoIP.Checked = true;
77 | tcs.GFWList.Checked = tcs.Global.Checked = false;
78 | break;
79 | }
80 | iniData["TCS"]["ProxyMode"] = ProxyMode2String(value);
81 | TCS.iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
82 |
83 | }
84 | get
85 | {
86 | if (tcs.Global.Checked)
87 | return ProxyMode.Full;
88 | if (tcs.GFWList.Checked)
89 | return ProxyMode.GFWList;
90 | if (tcs.GeoIP.Checked)
91 | return ProxyMode.Clash;
92 | return ProxyMode.Clash;
93 | }
94 |
95 | }
96 | public static bool verifyHostname
97 | {
98 | set
99 | {
100 | tcs.isVerifyHostname.Checked = value;
101 | iniData["TCS"]["VerifyHostname"] = value.ToString();
102 | TCS.iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
103 | }
104 | get => tcs.isVerifyHostname.Checked;
105 | }
106 | public static bool verifyCert
107 | {
108 | set
109 | {
110 | tcs.isVerifyCert.Checked = value;
111 | iniData["TCS"]["VerifyCert"] = value.ToString();
112 | TCS.iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
113 | }
114 | get => tcs.isVerifyCert.Checked;
115 |
116 | }
117 |
118 | public static bool httpProxy
119 | {
120 | set
121 | {
122 | tcs.isHttp.Checked = value;
123 | iniData["TCS"]["HttpProxy"] = value.ToString();
124 | TCS.iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
125 |
126 | }
127 | get => tcs.isHttp.Checked;
128 |
129 | }
130 |
131 | public static int localHttpPort
132 | {
133 | set
134 | {
135 | tcs.HttpPortBox.Text = iniData["TCS"]["LocalHttpPort"] = value.ToString();
136 | TCS.iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
137 | }
138 | get => int.Parse(tcs.HttpPortBox.Text);
139 | }
140 |
141 | public static int localSocksPort
142 | {
143 | set
144 | {
145 | tcs.SocksPortBox.Text = iniData["TCS"]["LocalSocksPort"] = value.ToString();
146 |
147 | TCS.iniParser.WriteFile(Config.DEFAULT_CONFIG_PATH, Config.iniData);
148 | }
149 | get => int.Parse(tcs.SocksPortBox.Text);
150 | }
151 |
152 | public static string remoteAddress
153 | {
154 | set => tcs.RemoteAddressBox.Text = value;
155 | get => tcs.RemoteAddressBox.Text;
156 | }
157 |
158 | public static int remotePort
159 | {
160 | set => tcs.RemotePortBox.Text = value.ToString();
161 | get => int.Parse(tcs.RemotePortBox.Text);
162 | }
163 |
164 | public static string password
165 | {
166 | set => tcs.PasswordBox.Text = value;
167 | get => tcs.PasswordBox.Text;
168 | }
169 |
170 | public const string DEFAULT_CONFIG_SECTION = "TCS";
171 | public const string SECTION_HTTP_PROXY = "HttpProxy";
172 |
173 | public const string DEFAULT_CONFIG_PATH = "config.ini";
174 | public const string DEFAULT_CONFIG_INI =
175 | "[TCS]\r\n" +
176 | "HttpProxy = true\r\n" +
177 | "LocalSocksPort = 1080\r\n" +
178 | "LocalHttpPort = 56784\r\n" +
179 | "VerifyCert = true\r\n" +
180 | "VerifyHostname = true\r\n" +
181 | "Proxy = GFWList\r\n" +
182 | "Debug = false";
183 |
184 | public const string DEFAULT_CLASH_CONFIG_PATH = "clash\\config.yaml";
185 | public const string DEFAULT_PRIVOXY_FILE_PATH = "privoxy";
186 |
187 | public static SniList sniList;
188 |
189 | public const string DEFAULT_NODELIST_JSON =
190 | "ewogICJEZWZhdWx0IjogWwogICAgInRyb2phbjovL0hlbGxv" +
191 | "V29ybGRAZ29vZ2xlLmNvbTo0NDMjRGVmYXVsdCIKICBdCn0K";
192 |
193 |
194 | }
195 | }
196 |
--------------------------------------------------------------------------------
/TCS/Util/Encrypt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Security.Cryptography;
3 | using System.Text;
4 |
5 | namespace TCS.Util
6 | {
7 | public static class Encrypt
8 | {
9 | public static string Base64(string str)
10 | {
11 | try
12 | {
13 | return Convert.ToBase64String((byte[])Encoding.UTF8.GetBytes(str));
14 | }
15 | catch
16 | {
17 | throw new InvalidCastException();
18 | }
19 | }
20 |
21 | public static string DeBase64(string str, bool IsExceptionReturnSourceData = false)
22 | {
23 | try
24 | {
25 | return Encoding.UTF8.GetString((byte[])Convert.FromBase64String(str));
26 | }
27 | catch
28 | {
29 | if (IsExceptionReturnSourceData)
30 | return str;
31 | throw new FormatException();
32 | }
33 | }
34 |
35 | private static readonly SHA1CryptoServiceProvider _sha1 = new SHA1CryptoServiceProvider();
36 | public static string SHA1(string str) => BitConverter.ToString((byte[])_sha1.ComputeHash((byte[])Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty).ToLower();
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/TCS/Util/Http.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Net;
3 |
4 | namespace TCS.Util
5 | {
6 | public static class Http
7 | {
8 | public static string GET(string url)
9 | {
10 | if (url.ToLower().StartsWith("https"))
11 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
12 | WebRequest request = WebRequest.Create(url);
13 | request.ContentType = "text/html; charset=utf-8";
14 | request.Method = "GET";
15 | WebResponse response = request.GetResponse();
16 | string v;
17 | using (Stream dataStream = response.GetResponseStream())
18 | {
19 | StreamReader reader = new StreamReader(dataStream);
20 | v = reader.ReadToEnd();
21 | }
22 |
23 | response.Close();
24 |
25 | return v;
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/TCS/Util/LnkHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Reflection;
4 |
5 | namespace TCS.Util
6 | {
7 | public static class LnkHelper
8 | {
9 | public static void SetLnk()
10 | {
11 | var shellType = Type.GetTypeFromProgID("WScript.Shell");
12 | dynamic shell = Activator.CreateInstance(shellType);
13 | var shortcut = shell.CreateShortcut(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "TCS.lnk"));
14 | shortcut.TargetPath = Assembly.GetEntryAssembly().Location;
15 | shortcut.Arguments = "silence";
16 | shortcut.WorkingDirectory = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
17 | shortcut.Save();
18 | }
19 |
20 | public static void RemoveLnk()
21 | {
22 | File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "TCS.lnk"));
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/TCS/Util/Message.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace TCS.Util
5 | {
6 | class Message
7 | {
8 | public enum Mode { Info = 0, Warning = 1, Error = 2 };
9 | public static void Show(string content, Mode messageMode = Mode.Info)
10 | {
11 | switch (messageMode)
12 | {
13 | case Mode.Error:
14 | MessageBox.Show(content, "FATAL ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
15 | break;
16 | case Mode.Info:
17 | MessageBox.Show(content, "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
18 | break;
19 | case Mode.Warning:
20 | MessageBox.Show(content, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
21 | break;
22 | default:
23 | throw new IndexOutOfRangeException();
24 | }
25 |
26 | }
27 |
28 | public Message(string content, Mode messageMode = Mode.Info) => Show(content, messageMode);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/TCS/Util/NodeList.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Linq;
3 |
4 | using System.Windows.Forms;
5 |
6 | namespace TCS.Util
7 | {
8 | public static class NodeList
9 | {
10 | /* Node.json Example
11 | * {
12 | * "Tree0": [
13 | * "Node#0",
14 | * "Node#1"
15 | * ],
16 | * "Tree1": [
17 | * "Node#0",
18 | * "Node#1"
19 | * ]
20 | * }
21 | *
22 | * Tree0 & Tree1 is Group
23 | * Node* is node(share link)
24 | *
25 | * NodeInfo
26 | * Name -> Node Name
27 | * Tag -> NodeShareLink
28 | */
29 |
30 | public static void BindTreeView(TreeView treeView, string json)
31 | {
32 | treeView.Nodes.Clear();
33 |
34 | if (IsJOjbect(json))
35 | {
36 | JObject jo = (JObject)JsonConvert.DeserializeObject(json);
37 |
38 | foreach (var item in jo)
39 | {
40 | TreeNode tree;
41 | if (item.Value.GetType() == typeof(JArray))
42 | {
43 | tree = new TreeNode(item.Key);
44 | AddTreeChildNode(ref tree, item.Value.ToString());
45 | treeView.Nodes.Add(tree);
46 | }
47 | else
48 | {
49 | MessageBox.Show($"NODE.JSON ERRER {item.GetType()}");
50 | }
51 | }
52 | }
53 | treeView.ExpandAll();
54 | }
55 | public static void AddTreeChildNode(ref TreeNode parantNode, string value)
56 | {
57 | //MessageBox.Show(value + " " + IsJOjbect(value) + " " + IsJArray(value));
58 | if (IsJArray(value))
59 | {
60 | JArray ja = (JArray)JsonConvert.DeserializeObject(value);
61 | foreach (JValue item in ja)
62 | {
63 | string v = item.ToString();
64 | string[] vv = v.Split('#');
65 | TreeNode tOb = new TreeNode();
66 | if (vv.Length == 2)
67 | {
68 | tOb.Text = vv[1];
69 | }
70 | else if (vv.Length == 1)
71 | {
72 | tOb.Text = "Untitled";
73 | }
74 | else
75 | {
76 | vv[0] = string.Empty;
77 | tOb.Text = ShareLink.CombineToString(vv);
78 | }
79 | tOb.Tag = v;
80 | parantNode.Nodes.Add(tOb);
81 | }
82 | }
83 | }
84 | private static bool IsJOjbect(string value)
85 | {
86 | try
87 | {
88 | JObject ja = JObject.Parse(value);
89 | return true;
90 | }
91 | catch
92 | {
93 | return false;
94 | }
95 | }
96 | private static bool IsJArray(string value)
97 | {
98 | try
99 | {
100 | JArray ja = JArray.Parse(value);
101 | return true;
102 | }
103 | catch
104 | {
105 | return false;
106 | }
107 | }
108 |
109 | public static JObject ToJObject(this TreeView tv)
110 | {
111 | var jo = new JObject();
112 | JArray ja;
113 | for (int i = 0; i < tv.Nodes.Count; i++)
114 | {
115 | ja = new JArray();
116 | foreach (TreeNode v in tv.Nodes[i].Nodes)
117 | {
118 | // Tag storages share link
119 | if (v.Tag != null)
120 | ja.Add(v.Tag);
121 | }
122 | // Root node's name is group name
123 | jo.Add(tv.Nodes[i].Text, ja);
124 | }
125 |
126 | return jo;
127 | }
128 |
129 |
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/TCS/Util/Proxy.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace TCS.Util
5 | {
6 | class Proxy
7 | {
8 | public static bool UnsetProxy()
9 | {
10 | return SetProxy(null, null);
11 | }
12 | public static bool SetProxy(string strProxy)
13 | {
14 | return SetProxy(strProxy, null);
15 | }
16 |
17 | public static bool SetProxy(string strProxy, string exceptions)
18 | {
19 | InternetPerConnOptionList list = new InternetPerConnOptionList();
20 |
21 | int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3);
22 | InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
23 | // USE a proxy server ...
24 | options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
25 | options[0].m_Value.m_Int = (int)((optionCount < 2) ? PerConnFlags.PROXY_TYPE_DIRECT : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
26 | // use THIS proxy server
27 | if (optionCount > 1)
28 | {
29 | options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
30 | options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
31 | // except for these addresses ...
32 | if (optionCount > 2)
33 | {
34 | options[2].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_BYPASS;
35 | options[2].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(exceptions);
36 | }
37 | }
38 |
39 | // default stuff
40 | list.dwSize = Marshal.SizeOf(list);
41 | list.szConnection = IntPtr.Zero;
42 | list.dwOptionCount = options.Length;
43 | list.dwOptionError = 0;
44 |
45 |
46 | int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
47 | // make a pointer out of all that ...
48 | IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
49 | // copy the array over into that spot in memory ...
50 | for (int i = 0; i < options.Length; ++i)
51 | {
52 | IntPtr opt = new IntPtr(optionsPtr.ToInt64() + (i * optSize));
53 | Marshal.StructureToPtr(options[i], opt, false);
54 | }
55 |
56 | list.options = optionsPtr;
57 |
58 | // and then make a pointer out of the whole list
59 | IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
60 | Marshal.StructureToPtr(list, ipcoListPtr, false);
61 |
62 | // and finally, call the API method!
63 | int returnvalue = NativeMethods.InternetSetOption(IntPtr.Zero,
64 | InternetOption.INTERNET_OPTION_PER_CONNECTION_OPTION,
65 | ipcoListPtr, list.dwSize) ? -1 : 0;
66 | if (returnvalue == 0)
67 | { // get the error codes, they might be helpful
68 | returnvalue = Marshal.GetLastWin32Error();
69 | }
70 | // FREE the data ASAP
71 | Marshal.FreeCoTaskMem(optionsPtr);
72 | Marshal.FreeCoTaskMem(ipcoListPtr);
73 | if (returnvalue > 0)
74 | {
75 | //throw new Win32Exception(Marshal.GetLastWin32Error());
76 | }
77 |
78 | return (returnvalue < 0);
79 | }
80 |
81 |
82 | #region WinInet structures
83 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
84 | public struct InternetPerConnOptionList
85 | {
86 | public int dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
87 | public IntPtr szConnection; // connection name to set/query options
88 | public int dwOptionCount; // number of options to set/query
89 | public int dwOptionError; // on error, which option failed
90 | //[MarshalAs(UnmanagedType.)]
91 | public IntPtr options;
92 | };
93 |
94 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
95 | public struct InternetConnectionOption
96 | {
97 | static readonly int Size = Marshal.SizeOf(typeof(InternetConnectionOption));
98 | public PerConnOption m_Option;
99 | public InternetConnectionOptionValue m_Value;
100 |
101 | // Nested Types
102 | [StructLayout(LayoutKind.Explicit)]
103 | public struct InternetConnectionOptionValue
104 | {
105 | // Fields
106 | [FieldOffset(0)]
107 | public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
108 | [FieldOffset(0)]
109 | public int m_Int;
110 | [FieldOffset(0)]
111 | public IntPtr m_StringPtr;
112 | }
113 | }
114 | #endregion
115 |
116 | #region WinInet enums
117 | //
118 | // options manifests for Internet{Query|Set}Option
119 | //
120 | public enum InternetOption : uint
121 | {
122 | INTERNET_OPTION_PER_CONNECTION_OPTION = 75
123 | }
124 |
125 | //
126 | // Options used in INTERNET_PER_CONN_OPTON struct
127 | //
128 | public enum PerConnOption
129 | {
130 | INTERNET_PER_CONN_FLAGS = 1, // Sets or retrieves the connection type. The Value member will contain one or more of the values from PerConnFlags
131 | INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
132 | INTERNET_PER_CONN_PROXY_BYPASS = 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
133 | INTERNET_PER_CONN_AUTOCONFIG_URL = 4//, // Sets or retrieves a string containing the URL to the automatic configuration script.
134 |
135 | }
136 |
137 | //
138 | // PER_CONN_FLAGS
139 | //
140 | [Flags]
141 | public enum PerConnFlags
142 | {
143 | PROXY_TYPE_DIRECT = 0x00000001, // direct to net
144 | PROXY_TYPE_PROXY = 0x00000002, // via named proxy
145 | PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
146 | PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
147 | }
148 | #endregion
149 |
150 | internal static class NativeMethods
151 | {
152 | [DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
153 | [return: MarshalAs(UnmanagedType.Bool)]
154 | public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer, int dwBufferLength);
155 | }
156 |
157 | }
158 | }
--------------------------------------------------------------------------------
/TCS/Util/ShareLink.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Web;
3 |
4 | namespace TCS.Util
5 | {
6 | public static class ShareLink
7 | {
8 | public static string[] ConvertShareToTrojanConf(string trojanShareLink)
9 | {
10 | //Example: trojan://password@ip:port#node_name
11 | if (trojanShareLink.StartsWith("trojan://"))
12 | {
13 |
14 | /*
15 | * 0 -> Server
16 | * 1 -> Port
17 | * 2 -> Passwd
18 | * 3 -> Name
19 | */
20 | string[] tmp = new string[5];
21 |
22 | string tsl = trojanShareLink.Substring(9);
23 | string[] tmp_1 = tsl.Split('#');
24 | if (tmp_1.Length == 2)
25 | tmp[3] = tmp_1[1];
26 | else
27 | tmp[3] = "Untitled";
28 |
29 | //tmp_1[0] -> pass@serv:port
30 |
31 | string[] tmp_2 = tmp_1[0].Split('@');
32 | tmp[2] = HttpUtility.UrlDecode(tmp_2[0]);
33 |
34 | //tmp_2[1] -> serv:port
35 | string[] tmp_3 = tmp_2[1].Split(':');
36 |
37 | if (int.TryParse(tmp_3[tmp_3.Length - 1], out int p))
38 | tmp[1] = p.ToString();
39 | else
40 | return null;
41 |
42 | tmp[0] = tmp_2[1].Substring(0, tmp_2[1].Length - tmp[1].Length - 1);
43 |
44 | SetRightIP(ref tmp[0]);
45 |
46 | return tmp;
47 | }
48 | else
49 | return null;
50 | }
51 |
52 | public static string CombineToString(this string[] str)
53 | {
54 | string tmp = "";
55 | foreach (string s in str)
56 | {
57 | tmp += s;
58 | }
59 | return tmp;
60 | }
61 |
62 | public static string Generate(string remoteAddress, string remotePort, string password, string nodeName = "Untitled")
63 | {
64 | if (string.IsNullOrEmpty(nodeName))
65 | nodeName = "Untitled";
66 | if (string.IsNullOrEmpty(remotePort))
67 | remotePort = "443";
68 |
69 | SetRightIP(ref remoteAddress);
70 |
71 | try
72 | {
73 | int.Parse(remotePort);
74 | }
75 | catch
76 | {
77 | remotePort = "443";
78 | }
79 |
80 | return "trojan://" + HttpUtility.UrlEncode(password) + "@" + remoteAddress.Trim() + ":" + remotePort + "#" + nodeName;
81 | }
82 |
83 | private static void SetRightIP(ref string ip)
84 | {
85 | if (IPAddress.TryParse(ip, out IPAddress address))
86 | if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
87 | ip = "[" + address.ToString() + "]";
88 |
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/TCS/Util/SniList.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace TCS.Util
5 | {
6 | public class SniList
7 | {
8 | private Dictionary dic;
9 | public SniList()
10 | {
11 | dic = new Dictionary { };
12 | }
13 |
14 | public SniList(string[] snis)
15 | {
16 | dic = new Dictionary { };
17 | foreach (var sni in snis)
18 | {
19 | if (!string.IsNullOrWhiteSpace(sni) && sni.Contains(":"))
20 | {
21 | dic.Add(sni.Split(':')[0], sni.Split(':')[1]);
22 | }
23 | }
24 | }
25 |
26 | public void Add(string ip, string sni) => dic.Add(ip, sni);
27 |
28 | public void Remove(string ip) => dic.Remove(ip);
29 |
30 | public string[] ToArray()
31 | {
32 |
33 | var al = new List();
34 | foreach (var ip in dic)
35 | {
36 | al.Add($"{ip.Key}:{ip.Value}");
37 | }
38 | return al.ToArray();
39 | }
40 |
41 | public string this[string index]
42 | {
43 | get
44 | {
45 | if (dic.Keys.Contains(index))
46 | return dic[index];
47 | else
48 | return string.Empty;
49 | }
50 | set => dic[index] = value;
51 | }
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/TCS/Util/TCSPath.cs:
--------------------------------------------------------------------------------
1 | namespace TCS.Util
2 | {
3 | public static class TCSPath
4 | {
5 | public const string NodeList = "db\\list.tcsdb";
6 |
7 | public const string Node = "db\\node.tcsdb";
8 |
9 | public const string Sni = "db\\sni.tcsdb";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/TCS/clash/Country.mmdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/TCS/clash/Country.mmdb
--------------------------------------------------------------------------------
/TCS/clash/clash.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/TCS/clash/clash.exe
--------------------------------------------------------------------------------
/TCS/clash/config.yaml:
--------------------------------------------------------------------------------
1 | port: {CLASH_HTTP_LISTEN} # HTTP proxy, not used
2 | socks-port: {CLASH_SOCKS_LISTEN}
3 | udp: true
4 | allow-lan: false
5 | mode: Rule
6 | log-level: silent
7 | #experimental:
8 | # ignore-resolve-fail: true
9 |
10 |
11 | dns:
12 | enable: false
13 | listen: 0.0.0.0:0 # the DNS server in clash is actually not used, turn it off
14 | enhanced-mode: fake-ip
15 | fake-ip-range: 255.0.128.1/20 # 255.0.128.1 - 255.0.143.254
16 | nameserver:
17 | - 114.114.114.114 # not used, just a placeholder
18 |
19 |
20 |
21 | Proxy:
22 | - { name: "trojan", type: socks5, server: "127.0.0.1", port: {TROJAN_SOCKS_LISTEN}, udp: true}
23 |
24 | Proxy Group:
25 | - { name: "Proxy", type: select, proxies: ["trojan"] }
26 |
27 |
28 | Rule:
29 | # Apple
30 | - DOMAIN-SUFFIX,apps.apple.com,Proxy
31 | - DOMAIN-SUFFIX,music.apple.com,DIRECT
32 | - DOMAIN-SUFFIX,icloud.com,DIRECT
33 | - DOMAIN-SUFFIX,icloud-content.com,DIRECT
34 | - DOMAIN-SUFFIX,me.com,DIRECT
35 | - DOMAIN-SUFFIX,mzstatic.com,DIRECT
36 | - DOMAIN-SUFFIX,akadns.net,DIRECT
37 | - DOMAIN-SUFFIX,aaplimg.com,DIRECT
38 | - DOMAIN-SUFFIX,cdn-apple.com,DIRECT
39 | - DOMAIN-SUFFIX,apple.com,DIRECT
40 | - DOMAIN-SUFFIX,apple-cloudkit.com,DIRECT
41 | - DOMAIN,hls.itunes.apple.com,Proxy
42 | #- DOMAIN,e.crashlytics.com,REJECT //注释此选项有助于大多数App开发者分析崩溃信息;如果您拒绝一切崩溃数据统计、搜集,请取消 # 注释。
43 |
44 |
45 | # 自定义规则
46 | ## 您可以在此处插入您补充的自定义规则
47 |
48 | # 国内网站
49 | - DOMAIN-SUFFIX,cn,DIRECT
50 | - DOMAIN-KEYWORD,-cn,DIRECT
51 |
52 | - DOMAIN-SUFFIX,126.com,DIRECT
53 | - DOMAIN-SUFFIX,126.net,DIRECT
54 | - DOMAIN-SUFFIX,127.net,DIRECT
55 | - DOMAIN-SUFFIX,163.com,DIRECT
56 | - DOMAIN-SUFFIX,360buyimg.com,DIRECT
57 | - DOMAIN-SUFFIX,36kr.com,DIRECT
58 | - DOMAIN-SUFFIX,acfun.tv,DIRECT
59 | - DOMAIN-SUFFIX,air-matters.com,DIRECT
60 | - DOMAIN-SUFFIX,aixifan.com,DIRECT
61 | - DOMAIN-SUFFIX,akamaized.net,DIRECT
62 | - DOMAIN-KEYWORD,alicdn,DIRECT
63 | - DOMAIN-KEYWORD,alipay,DIRECT
64 | - DOMAIN-KEYWORD,taobao,DIRECT
65 | - DOMAIN-SUFFIX,amap.com,DIRECT
66 | - DOMAIN-SUFFIX,autonavi.com,DIRECT
67 | - DOMAIN-KEYWORD,baidu,DIRECT
68 | - DOMAIN-SUFFIX,baidu.com,DIRECT
69 | - DOMAIN-SUFFIX,bdimg.com,DIRECT
70 | - DOMAIN-SUFFIX,bdstatic.com,DIRECT
71 | - DOMAIN-SUFFIX,bilibili.com,DIRECT
72 | - DOMAIN-SUFFIX,caiyunapp.com,DIRECT
73 | - DOMAIN-SUFFIX,clouddn.com,DIRECT
74 | - DOMAIN-SUFFIX,cnbeta.com,DIRECT
75 | - DOMAIN-SUFFIX,cnbetacdn.com,DIRECT
76 | - DOMAIN-SUFFIX,cootekservice.com,DIRECT
77 | - DOMAIN-SUFFIX,csdn.net,DIRECT
78 | - DOMAIN-SUFFIX,ctrip.com,DIRECT
79 | - DOMAIN-SUFFIX,dgtle.com,DIRECT
80 | - DOMAIN-SUFFIX,dianping.com,DIRECT
81 | - DOMAIN-SUFFIX,douban.com,DIRECT
82 | - DOMAIN-SUFFIX,doubanio.com,DIRECT
83 | - DOMAIN-SUFFIX,duokan.com,DIRECT
84 | - DOMAIN-SUFFIX,easou.com,DIRECT
85 | - DOMAIN-SUFFIX,ele.me,DIRECT
86 | - DOMAIN-SUFFIX,feng.com,DIRECT
87 | - DOMAIN-SUFFIX,fir.im,DIRECT
88 | - DOMAIN-SUFFIX,frdic.com,DIRECT
89 | - DOMAIN-SUFFIX,g-cores.com,DIRECT
90 | - DOMAIN-SUFFIX,godic.net,DIRECT
91 | - DOMAIN-SUFFIX,gtimg.com,DIRECT
92 | - DOMAIN,cdn.hockeyapp.net,DIRECT
93 | - DOMAIN-SUFFIX,hongxiu.com,DIRECT
94 | - DOMAIN-SUFFIX,hxcdn.net,DIRECT
95 | - DOMAIN-SUFFIX,iciba.com,DIRECT
96 | - DOMAIN-SUFFIX,ifeng.com,DIRECT
97 | - DOMAIN-SUFFIX,ifengimg.com,DIRECT
98 | - DOMAIN-SUFFIX,ipip.net,DIRECT
99 | - DOMAIN-SUFFIX,iqiyi.com,DIRECT
100 | - DOMAIN-SUFFIX,jd.com,DIRECT
101 | - DOMAIN-SUFFIX,jianshu.com,DIRECT
102 | - DOMAIN-SUFFIX,knewone.com,DIRECT
103 | - DOMAIN-SUFFIX,le.com,DIRECT
104 | - DOMAIN-SUFFIX,lecloud.com,DIRECT
105 | - DOMAIN-SUFFIX,lemicp.com,DIRECT
106 | - DOMAIN-SUFFIX,licdn.com,DIRECT
107 | - DOMAIN-SUFFIX,linkedin.com,DIRECT
108 | - DOMAIN-SUFFIX,luoo.net,DIRECT
109 | - DOMAIN-SUFFIX,meituan.com,DIRECT
110 | - DOMAIN-SUFFIX,meituan.net,DIRECT
111 | - DOMAIN-SUFFIX,mi.com,DIRECT
112 | - DOMAIN-SUFFIX,miaopai.com,DIRECT
113 | - DOMAIN-SUFFIX,microsoft.com,DIRECT
114 | - DOMAIN-SUFFIX,microsoftonline.com,DIRECT
115 | - DOMAIN-SUFFIX,miui.com,DIRECT
116 | - DOMAIN-SUFFIX,miwifi.com,DIRECT
117 | - DOMAIN-SUFFIX,mob.com,DIRECT
118 | - DOMAIN-SUFFIX,netease.com,DIRECT
119 | - DOMAIN-SUFFIX,office.com,DIRECT
120 | - DOMAIN-SUFFIX,office365.com,DIRECT
121 | - DOMAIN-KEYWORD,officecdn,DIRECT
122 | - DOMAIN-SUFFIX,oschina.net,DIRECT
123 | - DOMAIN-SUFFIX,ppsimg.com,DIRECT
124 | - DOMAIN-SUFFIX,pstatp.com,DIRECT
125 | - DOMAIN-SUFFIX,qcloud.com,DIRECT
126 | - DOMAIN-SUFFIX,qdaily.com,DIRECT
127 | - DOMAIN-SUFFIX,qdmm.com,DIRECT
128 | - DOMAIN-SUFFIX,qhimg.com,DIRECT
129 | - DOMAIN-SUFFIX,qhres.com,DIRECT
130 | - DOMAIN-SUFFIX,qidian.com,DIRECT
131 | - DOMAIN-SUFFIX,qihucdn.com,DIRECT
132 | - DOMAIN-SUFFIX,qiniu.com,DIRECT
133 | - DOMAIN-SUFFIX,qiniucdn.com,DIRECT
134 | - DOMAIN-SUFFIX,qiyipic.com,DIRECT
135 | - DOMAIN-SUFFIX,qq.com,DIRECT
136 | - DOMAIN-SUFFIX,qqurl.com,DIRECT
137 | - DOMAIN-SUFFIX,rarbg.to,DIRECT
138 | - DOMAIN-SUFFIX,ruguoapp.com,DIRECT
139 | - DOMAIN-SUFFIX,segmentfault.com,DIRECT
140 | - DOMAIN-SUFFIX,sinaapp.com,DIRECT
141 | - DOMAIN-SUFFIX,smzdm.com,DIRECT
142 | - DOMAIN-SUFFIX,snapdrop.net,DIRECT
143 | - DOMAIN-SUFFIX,sogou.com,DIRECT
144 | - DOMAIN-SUFFIX,sogoucdn.com,DIRECT
145 | - DOMAIN-SUFFIX,sohu.com,DIRECT
146 | - DOMAIN-SUFFIX,soku.com,DIRECT
147 | - DOMAIN-SUFFIX,speedtest.net,DIRECT
148 | - DOMAIN-SUFFIX,sspai.com,DIRECT
149 | - DOMAIN-SUFFIX,suning.com,DIRECT
150 | - DOMAIN-SUFFIX,taobao.com,DIRECT
151 | - DOMAIN-SUFFIX,tencent.com,DIRECT
152 | - DOMAIN-SUFFIX,tenpay.com,DIRECT
153 | - DOMAIN-SUFFIX,tianyancha.com,DIRECT
154 | - DOMAIN-SUFFIX,tmall.com,DIRECT
155 | - DOMAIN-SUFFIX,tudou.com,DIRECT
156 | - DOMAIN-SUFFIX,umetrip.com,DIRECT
157 | - DOMAIN-SUFFIX,upaiyun.com,DIRECT
158 | - DOMAIN-SUFFIX,upyun.com,DIRECT
159 | - DOMAIN-SUFFIX,veryzhun.com,DIRECT
160 | - DOMAIN-SUFFIX,weather.com,DIRECT
161 | - DOMAIN-SUFFIX,weibo.com,DIRECT
162 | - DOMAIN-SUFFIX,xiami.com,DIRECT
163 | - DOMAIN-SUFFIX,xiami.net,DIRECT
164 | - DOMAIN-SUFFIX,xiaomicp.com,DIRECT
165 | - DOMAIN-SUFFIX,ximalaya.com,DIRECT
166 | - DOMAIN-SUFFIX,xmcdn.com,DIRECT
167 | - DOMAIN-SUFFIX,xunlei.com,DIRECT
168 | - DOMAIN-SUFFIX,yhd.com,DIRECT
169 | - DOMAIN-SUFFIX,yihaodianimg.com,DIRECT
170 | - DOMAIN-SUFFIX,yinxiang.com,DIRECT
171 | - DOMAIN-SUFFIX,ykimg.com,DIRECT
172 | - DOMAIN-SUFFIX,youdao.com,DIRECT
173 | - DOMAIN-SUFFIX,youku.com,DIRECT
174 | - DOMAIN-SUFFIX,zealer.com,DIRECT
175 | - DOMAIN-SUFFIX,zhihu.com,DIRECT
176 | - DOMAIN-SUFFIX,zhimg.com,DIRECT
177 | - DOMAIN-SUFFIX,zimuzu.tv,DIRECT
178 |
179 | # 抗 DNS 污染
180 | - DOMAIN-KEYWORD,amazon,Proxy
181 | - DOMAIN-KEYWORD,google,Proxy
182 | - DOMAIN-KEYWORD,gmail,Proxy
183 | - DOMAIN-KEYWORD,youtube,Proxy
184 | - DOMAIN-KEYWORD,facebook,Proxy
185 | - DOMAIN-SUFFIX,fb.me,Proxy
186 | - DOMAIN-SUFFIX,fbcdn.net,Proxy
187 | - DOMAIN-KEYWORD,twitter,Proxy
188 | - DOMAIN-KEYWORD,instagram,Proxy
189 | - DOMAIN-KEYWORD,dropbox,Proxy
190 | - DOMAIN-SUFFIX,twimg.com,Proxy
191 | - DOMAIN-KEYWORD,blogspot,Proxy
192 | - DOMAIN-SUFFIX,youtu.be,Proxy
193 | - DOMAIN-KEYWORD,whatsapp,Proxy
194 |
195 | # 常见广告域名屏蔽
196 | #- DOMAIN-KEYWORD,admarvel,REJECT
197 | #- DOMAIN-KEYWORD,admaster,REJECT
198 | #- DOMAIN-KEYWORD,adsage,REJECT
199 | #- DOMAIN-KEYWORD,adsmogo,REJECT
200 | #- DOMAIN-KEYWORD,adsrvmedia,REJECT
201 | #- DOMAIN-KEYWORD,adwords,REJECT
202 | #- DOMAIN-KEYWORD,adservice,REJECT
203 | #- DOMAIN-KEYWORD,domob,REJECT
204 | #- DOMAIN-KEYWORD,duomeng,REJECT
205 | #- DOMAIN-KEYWORD,dwtrack,REJECT
206 | #- DOMAIN-KEYWORD,guanggao,REJECT
207 | #- DOMAIN-KEYWORD,lianmeng,REJECT
208 | #- DOMAIN-SUFFIX,mmstat.com,REJECT
209 | #- DOMAIN-KEYWORD,omgmta,REJECT
210 | #- DOMAIN-KEYWORD,openx,REJECT
211 | #- DOMAIN-KEYWORD,partnerad,REJECT
212 | #- DOMAIN-KEYWORD,pingfore,REJECT
213 | #- DOMAIN-KEYWORD,supersonicads,REJECT
214 | #- DOMAIN-KEYWORD,tracking,REJECT
215 | #- DOMAIN-KEYWORD,uedas,REJECT
216 | #- DOMAIN-KEYWORD,umeng,REJECT
217 | #- DOMAIN-KEYWORD,usage,REJECT
218 | #- DOMAIN-KEYWORD,wlmonitor,REJECT
219 | #- DOMAIN-KEYWORD,zjtoolbar,REJECT
220 |
221 | # 国外网站
222 | - DOMAIN-SUFFIX,9to5mac.com,Proxy
223 | - DOMAIN-SUFFIX,abpchina.org,Proxy
224 | - DOMAIN-SUFFIX,adblockplus.org,Proxy
225 | - DOMAIN-SUFFIX,adobe.com,Proxy
226 | - DOMAIN-SUFFIX,alfredapp.com,Proxy
227 | - DOMAIN-SUFFIX,amplitude.com,Proxy
228 | - DOMAIN-SUFFIX,ampproject.org,Proxy
229 | - DOMAIN-SUFFIX,android.com,Proxy
230 | - DOMAIN-SUFFIX,angularjs.org,Proxy
231 | - DOMAIN-SUFFIX,aolcdn.com,Proxy
232 | - DOMAIN-SUFFIX,apkpure.com,Proxy
233 | - DOMAIN-SUFFIX,appledaily.com,Proxy
234 | - DOMAIN-SUFFIX,appshopper.com,Proxy
235 | - DOMAIN-SUFFIX,appspot.com,Proxy
236 | - DOMAIN-SUFFIX,arcgis.com,Proxy
237 | - DOMAIN-SUFFIX,archive.org,Proxy
238 | - DOMAIN-SUFFIX,armorgames.com,Proxy
239 | - DOMAIN-SUFFIX,aspnetcdn.com,Proxy
240 | - DOMAIN-SUFFIX,att.com,Proxy
241 | - DOMAIN-SUFFIX,awsstatic.com,Proxy
242 | - DOMAIN-SUFFIX,azureedge.net,Proxy
243 | - DOMAIN-SUFFIX,azurewebsites.net,Proxy
244 | - DOMAIN-SUFFIX,bing.com,Proxy
245 | - DOMAIN-SUFFIX,bintray.com,Proxy
246 | - DOMAIN-SUFFIX,bit.com,Proxy
247 | - DOMAIN-SUFFIX,bit.ly,Proxy
248 | - DOMAIN-SUFFIX,bitbucket.org,Proxy
249 | - DOMAIN-SUFFIX,bjango.com,Proxy
250 | - DOMAIN-SUFFIX,bkrtx.com,Proxy
251 | - DOMAIN-SUFFIX,blog.com,Proxy
252 | - DOMAIN-SUFFIX,blogcdn.com,Proxy
253 | - DOMAIN-SUFFIX,blogger.com,Proxy
254 | - DOMAIN-SUFFIX,blogsmithmedia.com,Proxy
255 | - DOMAIN-SUFFIX,blogspot.com,Proxy
256 | - DOMAIN-SUFFIX,blogspot.hk,Proxy
257 | - DOMAIN-SUFFIX,bloomberg.com,Proxy
258 | - DOMAIN-SUFFIX,box.com,Proxy
259 | - DOMAIN-SUFFIX,box.net,Proxy
260 | - DOMAIN-SUFFIX,cachefly.net,Proxy
261 | - DOMAIN-SUFFIX,chromium.org,Proxy
262 | - DOMAIN-SUFFIX,cl.ly,Proxy
263 | - DOMAIN-SUFFIX,cloudflare.com,Proxy
264 | - DOMAIN-SUFFIX,cloudfront.net,Proxy
265 | - DOMAIN-SUFFIX,cloudmagic.com,Proxy
266 | - DOMAIN-SUFFIX,cmail19.com,Proxy
267 | - DOMAIN-SUFFIX,cnet.com,Proxy
268 | - DOMAIN-SUFFIX,cocoapods.org,Proxy
269 | - DOMAIN-SUFFIX,comodoca.com,Proxy
270 | - DOMAIN-SUFFIX,crashlytics.com,Proxy
271 | - DOMAIN-SUFFIX,culturedcode.com,Proxy
272 | - DOMAIN-SUFFIX,d.pr,Proxy
273 | - DOMAIN-SUFFIX,danilo.to,Proxy
274 | - DOMAIN-SUFFIX,dayone.me,Proxy
275 | - DOMAIN-SUFFIX,db.tt,Proxy
276 | - DOMAIN-SUFFIX,deskconnect.com,Proxy
277 | - DOMAIN-SUFFIX,disq.us,Proxy
278 | - DOMAIN-SUFFIX,disqus.com,Proxy
279 | - DOMAIN-SUFFIX,disquscdn.com,Proxy
280 | - DOMAIN-SUFFIX,dnsimple.com,Proxy
281 | - DOMAIN-SUFFIX,docker.com,Proxy
282 | - DOMAIN-SUFFIX,dribbble.com,Proxy
283 | - DOMAIN-SUFFIX,droplr.com,Proxy
284 | - DOMAIN-SUFFIX,duckduckgo.com,Proxy
285 | - DOMAIN-SUFFIX,dueapp.com,Proxy
286 | - DOMAIN-SUFFIX,dytt8.net,Proxy
287 | - DOMAIN-SUFFIX,edgecastcdn.net,Proxy
288 | - DOMAIN-SUFFIX,edgekey.net,Proxy
289 | - DOMAIN-SUFFIX,edgesuite.net,Proxy
290 | - DOMAIN-SUFFIX,engadget.com,Proxy
291 | - DOMAIN-SUFFIX,entrust.net,Proxy
292 | - DOMAIN-SUFFIX,eurekavpt.com,Proxy
293 | - DOMAIN-SUFFIX,evernote.com,Proxy
294 | - DOMAIN-SUFFIX,fabric.io,Proxy
295 | - DOMAIN-SUFFIX,fast.com,Proxy
296 | - DOMAIN-SUFFIX,fastly.net,Proxy
297 | - DOMAIN-SUFFIX,fc2.com,Proxy
298 | - DOMAIN-SUFFIX,feedburner.com,Proxy
299 | - DOMAIN-SUFFIX,feedly.com,Proxy
300 | - DOMAIN-SUFFIX,feedsportal.com,Proxy
301 | - DOMAIN-SUFFIX,fiftythree.com,Proxy
302 | - DOMAIN-SUFFIX,firebaseio.com,Proxy
303 | - DOMAIN-SUFFIX,flexibits.com,Proxy
304 | - DOMAIN-SUFFIX,flickr.com,Proxy
305 | - DOMAIN-SUFFIX,flipboard.com,Proxy
306 | - DOMAIN-SUFFIX,g.co,Proxy
307 | - DOMAIN-SUFFIX,gabia.net,Proxy
308 | - DOMAIN-SUFFIX,geni.us,Proxy
309 | - DOMAIN-SUFFIX,gfx.ms,Proxy
310 | - DOMAIN-SUFFIX,ggpht.com,Proxy
311 | - DOMAIN-SUFFIX,ghostnoteapp.com,Proxy
312 | - DOMAIN-SUFFIX,git.io,Proxy
313 | - DOMAIN-KEYWORD,github,Proxy
314 | - DOMAIN-SUFFIX,globalsign.com,Proxy
315 | - DOMAIN-SUFFIX,gmodules.com,Proxy
316 | - DOMAIN-SUFFIX,godaddy.com,Proxy
317 | - DOMAIN-SUFFIX,golang.org,Proxy
318 | - DOMAIN-SUFFIX,gongm.in,Proxy
319 | - DOMAIN-SUFFIX,goo.gl,Proxy
320 | - DOMAIN-SUFFIX,goodreaders.com,Proxy
321 | - DOMAIN-SUFFIX,goodreads.com,Proxy
322 | - DOMAIN-SUFFIX,gravatar.com,Proxy
323 | - DOMAIN-SUFFIX,gstatic.com,Proxy
324 | - DOMAIN-SUFFIX,gvt0.com,Proxy
325 | - DOMAIN-SUFFIX,hockeyapp.net,Proxy
326 | - DOMAIN-SUFFIX,hotmail.com,Proxy
327 | - DOMAIN-SUFFIX,icons8.com,Proxy
328 | - DOMAIN-SUFFIX,ifixit.com,Proxy
329 | - DOMAIN-SUFFIX,ift.tt,Proxy
330 | - DOMAIN-SUFFIX,ifttt.com,Proxy
331 | - DOMAIN-SUFFIX,iherb.com,Proxy
332 | - DOMAIN-SUFFIX,imageshack.us,Proxy
333 | - DOMAIN-SUFFIX,img.ly,Proxy
334 | - DOMAIN-SUFFIX,imgur.com,Proxy
335 | - DOMAIN-SUFFIX,imore.com,Proxy
336 | - DOMAIN-SUFFIX,instapaper.com,Proxy
337 | - DOMAIN-SUFFIX,ipn.li,Proxy
338 | - DOMAIN-SUFFIX,is.gd,Proxy
339 | - DOMAIN-SUFFIX,issuu.com,Proxy
340 | - DOMAIN-SUFFIX,itgonglun.com,Proxy
341 | - DOMAIN-SUFFIX,itun.es,Proxy
342 | - DOMAIN-SUFFIX,ixquick.com,Proxy
343 | - DOMAIN-SUFFIX,j.mp,Proxy
344 | - DOMAIN-SUFFIX,js.revsci.net,Proxy
345 | - DOMAIN-SUFFIX,jshint.com,Proxy
346 | - DOMAIN-SUFFIX,jtvnw.net,Proxy
347 | - DOMAIN-SUFFIX,justgetflux.com,Proxy
348 | - DOMAIN-SUFFIX,kat.cr,Proxy
349 | - DOMAIN-SUFFIX,klip.me,Proxy
350 | - DOMAIN-SUFFIX,libsyn.com,Proxy
351 | - DOMAIN-SUFFIX,linode.com,Proxy
352 | - DOMAIN-SUFFIX,lithium.com,Proxy
353 | - DOMAIN-SUFFIX,littlehj.com,Proxy
354 | - DOMAIN-SUFFIX,live.com,Proxy
355 | - DOMAIN-SUFFIX,live.net,Proxy
356 | - DOMAIN-SUFFIX,livefilestore.com,Proxy
357 | - DOMAIN-SUFFIX,llnwd.net,Proxy
358 | - DOMAIN-SUFFIX,macid.co,Proxy
359 | - DOMAIN-SUFFIX,macromedia.com,Proxy
360 | - DOMAIN-SUFFIX,macrumors.com,Proxy
361 | - DOMAIN-SUFFIX,mashable.com,Proxy
362 | - DOMAIN-SUFFIX,mathjax.org,Proxy
363 | - DOMAIN-SUFFIX,medium.com,Proxy
364 | - DOMAIN-SUFFIX,mega.co.nz,Proxy
365 | - DOMAIN-SUFFIX,mega.nz,Proxy
366 | - DOMAIN-SUFFIX,megaupload.com,Proxy
367 | - DOMAIN-SUFFIX,microsofttranslator.com,Proxy
368 | - DOMAIN-SUFFIX,mindnode.com,Proxy
369 | - DOMAIN-SUFFIX,mobile01.com,Proxy
370 | - DOMAIN-SUFFIX,modmyi.com,Proxy
371 | - DOMAIN-SUFFIX,msedge.net,Proxy
372 | - DOMAIN-SUFFIX,myfontastic.com,Proxy
373 | - DOMAIN-SUFFIX,name.com,Proxy
374 | - DOMAIN-SUFFIX,nextmedia.com,Proxy
375 | - DOMAIN-SUFFIX,nsstatic.net,Proxy
376 | - DOMAIN-SUFFIX,nssurge.com,Proxy
377 | - DOMAIN-SUFFIX,nyt.com,Proxy
378 | - DOMAIN-SUFFIX,nytimes.com,Proxy
379 | - DOMAIN-SUFFIX,omnigroup.com,Proxy
380 | - DOMAIN-SUFFIX,onedrive.com,Proxy
381 | - DOMAIN-SUFFIX,onenote.com,Proxy
382 | - DOMAIN-SUFFIX,ooyala.com,Proxy
383 | - DOMAIN-SUFFIX,openvpn.net,Proxy
384 | - DOMAIN-SUFFIX,openwrt.org,Proxy
385 | - DOMAIN-SUFFIX,orkut.com,Proxy
386 | - DOMAIN-SUFFIX,osxdaily.com,Proxy
387 | - DOMAIN-SUFFIX,outlook.com,Proxy
388 | - DOMAIN-SUFFIX,ow.ly,Proxy
389 | - DOMAIN-SUFFIX,paddleapi.com,Proxy
390 | - DOMAIN-SUFFIX,parallels.com,Proxy
391 | - DOMAIN-SUFFIX,parse.com,Proxy
392 | - DOMAIN-SUFFIX,pdfexpert.com,Proxy
393 | - DOMAIN-SUFFIX,periscope.tv,Proxy
394 | - DOMAIN-SUFFIX,pinboard.in,Proxy
395 | - DOMAIN-SUFFIX,pinterest.com,Proxy
396 | - DOMAIN-SUFFIX,pixelmator.com,Proxy
397 | - DOMAIN-SUFFIX,pixiv.net,Proxy
398 | - DOMAIN-SUFFIX,playpcesor.com,Proxy
399 | - DOMAIN-SUFFIX,playstation.com,Proxy
400 | - DOMAIN-SUFFIX,playstation.com.hk,Proxy
401 | - DOMAIN-SUFFIX,playstation.net,Proxy
402 | - DOMAIN-SUFFIX,playstationnetwork.com,Proxy
403 | - DOMAIN-SUFFIX,pushwoosh.com,Proxy
404 | - DOMAIN-SUFFIX,rime.im,Proxy
405 | - DOMAIN-SUFFIX,servebom.com,Proxy
406 | - DOMAIN-SUFFIX,sfx.ms,Proxy
407 | - DOMAIN-SUFFIX,shadowsocks.org,Proxy
408 | - DOMAIN-SUFFIX,sharethis.com,Proxy
409 | - DOMAIN-SUFFIX,shazam.com,Proxy
410 | - DOMAIN-SUFFIX,skype.com,Proxy
411 | - DOMAIN-SUFFIX,smartdnsProxy.com,Proxy
412 | - DOMAIN-SUFFIX,smartmailcloud.com,Proxy
413 | - DOMAIN-SUFFIX,sndcdn.com,Proxy
414 | - DOMAIN-SUFFIX,sony.com,Proxy
415 | - DOMAIN-SUFFIX,soundcloud.com,Proxy
416 | - DOMAIN-SUFFIX,sourceforge.net,Proxy
417 | - DOMAIN-SUFFIX,spotify.com,Proxy
418 | - DOMAIN-SUFFIX,squarespace.com,Proxy
419 | - DOMAIN-SUFFIX,sstatic.net,Proxy
420 | - DOMAIN-SUFFIX,st.luluku.pw,Proxy
421 | - DOMAIN-SUFFIX,stackoverflow.com,Proxy
422 | - DOMAIN-SUFFIX,startpage.com,Proxy
423 | - DOMAIN-SUFFIX,staticflickr.com,Proxy
424 | - DOMAIN-SUFFIX,steamcommunity.com,Proxy
425 | - DOMAIN-SUFFIX,symauth.com,Proxy
426 | - DOMAIN-SUFFIX,symcb.com,Proxy
427 | - DOMAIN-SUFFIX,symcd.com,Proxy
428 | - DOMAIN-SUFFIX,tapbots.com,Proxy
429 | - DOMAIN-SUFFIX,tapbots.net,Proxy
430 | - DOMAIN-SUFFIX,tdesktop.com,Proxy
431 | - DOMAIN-SUFFIX,techcrunch.com,Proxy
432 | - DOMAIN-SUFFIX,techsmith.com,Proxy
433 | - DOMAIN-SUFFIX,thepiratebay.org,Proxy
434 | - DOMAIN-SUFFIX,theverge.com,Proxy
435 | - DOMAIN-SUFFIX,time.com,Proxy
436 | - DOMAIN-SUFFIX,timeinc.net,Proxy
437 | - DOMAIN-SUFFIX,tiny.cc,Proxy
438 | - DOMAIN-SUFFIX,tinypic.com,Proxy
439 | - DOMAIN-SUFFIX,tmblr.co,Proxy
440 | - DOMAIN-SUFFIX,todoist.com,Proxy
441 | - DOMAIN-SUFFIX,trello.com,Proxy
442 | - DOMAIN-SUFFIX,trustasiassl.com,Proxy
443 | - DOMAIN-SUFFIX,tumblr.co,Proxy
444 | - DOMAIN-SUFFIX,tumblr.com,Proxy
445 | - DOMAIN-SUFFIX,tweetdeck.com,Proxy
446 | - DOMAIN-SUFFIX,tweetmarker.net,Proxy
447 | - DOMAIN-SUFFIX,twitch.tv,Proxy
448 | - DOMAIN-SUFFIX,txmblr.com,Proxy
449 | - DOMAIN-SUFFIX,typekit.net,Proxy
450 | - DOMAIN-SUFFIX,ubertags.com,Proxy
451 | - DOMAIN-SUFFIX,ublock.org,Proxy
452 | - DOMAIN-SUFFIX,ubnt.com,Proxy
453 | - DOMAIN-SUFFIX,ulyssesapp.com,Proxy
454 | - DOMAIN-SUFFIX,urchin.com,Proxy
455 | - DOMAIN-SUFFIX,usertrust.com,Proxy
456 | - DOMAIN-SUFFIX,v.gd,Proxy
457 | - DOMAIN-SUFFIX,v2ex.com,Proxy
458 | - DOMAIN-SUFFIX,vimeo.com,Proxy
459 | - DOMAIN-SUFFIX,vimeocdn.com,Proxy
460 | - DOMAIN-SUFFIX,vine.co,Proxy
461 | - DOMAIN-SUFFIX,vivaldi.com,Proxy
462 | - DOMAIN-SUFFIX,vox-cdn.com,Proxy
463 | - DOMAIN-SUFFIX,vsco.co,Proxy
464 | - DOMAIN-SUFFIX,vultr.com,Proxy
465 | - DOMAIN-SUFFIX,w.org,Proxy
466 | - DOMAIN-SUFFIX,w3schools.com,Proxy
467 | - DOMAIN-SUFFIX,webtype.com,Proxy
468 | - DOMAIN-SUFFIX,wikiwand.com,Proxy
469 | - DOMAIN-SUFFIX,wikileaks.org,Proxy
470 | - DOMAIN-SUFFIX,wikimedia.org,Proxy
471 | - DOMAIN-SUFFIX,wikipedia.com,Proxy
472 | - DOMAIN-SUFFIX,wikipedia.org,Proxy
473 | - DOMAIN-SUFFIX,windows.com,Proxy
474 | - DOMAIN-SUFFIX,windows.net,Proxy
475 | - DOMAIN-SUFFIX,wire.com,Proxy
476 | - DOMAIN-SUFFIX,wordpress.com,Proxy
477 | - DOMAIN-SUFFIX,workflowy.com,Proxy
478 | - DOMAIN-SUFFIX,wp.com,Proxy
479 | - DOMAIN-SUFFIX,wsj.com,Proxy
480 | - DOMAIN-SUFFIX,wsj.net,Proxy
481 | - DOMAIN-SUFFIX,xda-developers.com,Proxy
482 | - DOMAIN-SUFFIX,xeeno.com,Proxy
483 | - DOMAIN-SUFFIX,xiti.com,Proxy
484 | - DOMAIN-SUFFIX,yahoo.com,Proxy
485 | - DOMAIN-SUFFIX,yimg.com,Proxy
486 | - DOMAIN-SUFFIX,ying.com,Proxy
487 | - DOMAIN-SUFFIX,yoyo.org,Proxy
488 | - DOMAIN-SUFFIX,ytimg.com,Proxy
489 |
490 | # Telegram
491 | - DOMAIN-SUFFIX,telegra.ph,Proxy
492 | - DOMAIN-SUFFIX,telegram.org,Proxy
493 |
494 | - IP-CIDR,91.108.56.0/22,Proxy
495 | - IP-CIDR,91.108.4.0/22,Proxy
496 | - IP-CIDR,91.108.8.0/22,Proxy
497 | - IP-CIDR,109.239.140.0/24,Proxy
498 | - IP-CIDR,149.154.160.0/20,Proxy
499 | - IP-CIDR,149.154.164.0/22,Proxy
500 |
501 | # Locals are already bypassed by Android VPN service
502 | - IP-CIDR,127.0.0.0/8,DIRECT
503 | - IP-CIDR,172.16.0.0/12,DIRECT
504 | - IP-CIDR,172.19.0.0/12,DIRECT
505 | - IP-CIDR,192.168.0.0/16,DIRECT
506 | - IP-CIDR,10.0.0.0/8,DIRECT
507 | - IP-CIDR,17.0.0.0/8,DIRECT
508 | - IP-CIDR,100.64.0.0/10,DIRECT
509 |
510 | - GEOIP,CN,DIRECT
511 | - MATCH,Proxy
512 |
--------------------------------------------------------------------------------
/TCS/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/TCS/icon.ico
--------------------------------------------------------------------------------
/TCS/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/TCS/logo.ico
--------------------------------------------------------------------------------
/TCS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/TCS/privoxy/config.txt:
--------------------------------------------------------------------------------
1 | listen-address 127.0.0.1:{PRIVOXY_HTTP_LISTEN}
2 | show-on-task-bar 0
3 | activity-animation 0
4 | hide-console
5 | forward-socks5 / 127.0.0.1:{TROJAN_SOCKS_LISTEN} .
--------------------------------------------------------------------------------
/TCS/privoxy/config_gfw.txt:
--------------------------------------------------------------------------------
1 | listen-address 127.0.0.1:{PRIVOXY_HTTP_LISTEN}
2 | show-on-task-bar 0
3 | activity-animation 0
4 | hide-console
5 | actionsfile temp\gfwlist.action
--------------------------------------------------------------------------------
/TCS/privoxy/privoxy.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/TCS/privoxy/privoxy.exe
--------------------------------------------------------------------------------
/TCS/trojan/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "run_type": "client",
3 | "local_addr": "127.0.0.1",
4 | "local_port": 0,
5 | "remote_addr": "{REMOTE_ADDRESS}",
6 | "remote_port": 443,
7 | "password": [ "{PASSWORD}" ],
8 | "log_level": 1,
9 | "ssl": {
10 | "verify": "{VERIFY_CERT}",
11 | "verify_hostname": "{VERIFY_HOSTNAME}",
12 | "cert": "",
13 | "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA",
14 | "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
15 | "sni": "{SNI}",
16 | "alpn": [ "h2", "http/1.1" ],
17 | "reuse_session": true,
18 | "session_ticket": false,
19 | "curves": ""
20 | },
21 | "tcp": {
22 | "no_delay": true,
23 | "keep_alive": true,
24 | "reuse_port": false,
25 | "fast_open": false,
26 | "fast_open_qlen": 20
27 | }
28 | }
--------------------------------------------------------------------------------
/TCS/trojan/trojan.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/trojan-client-slim/7f72df14f894c70b3ef99665a0319616e9d6e782/TCS/trojan/trojan.exe
--------------------------------------------------------------------------------