36 | {
37 | server.Password
38 | },
39 | ssl = new TrojanSSL
40 | {
41 | sni = server.Host.ValueOrDefault() ?? server.Hostname
42 | }
43 | };
44 |
45 | await using (var fileStream = new FileStream(Constants.TempConfig, FileMode.Create, FileAccess.Write, FileShare.Read))
46 | {
47 | await JsonSerializer.SerializeAsync(fileStream, trojanConfig, Global.NewCustomJsonSerializerOptions());
48 | }
49 |
50 | await StartGuardAsync("-config ..\\data\\last.json");
51 | return new Socks5Server(IPAddress.Loopback.ToString(), this.Socks5LocalPort(), server.Hostname);
52 | }
53 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # `In preparation for 2.0, this repository will be cleared of all 1.0 related releases and code`
2 | 
3 |
4 |
5 |
6 | # Netch
7 | A simple proxy client
8 |
9 | [](https://t.me/netch_group)
10 | [](https://t.me/netch_channel)
11 | [](https://github.com/netchx/netch/releases)
12 | [](https://github.com/netchx/netch/releases)
13 |
14 |
15 | ## Features
16 | Some features may not be implemented in version 1
17 |
18 | ### Modes
19 | - `ProcessMode` - Use Netfilter driver to intercept process traffic
20 | - `ShareMode` - Share your network based on WinPcap / Npcap
21 | - `TunMode` - Use WinTUN driver to create virtual adapter
22 | - `WebMode` - Web proxy mode
23 |
24 | ### Protocols
25 | - [`Socks5`](https://www.wikiwand.com/en/SOCKS)
26 | - [`Shadowsocks`](https://shadowsocks.org)
27 | - [`ShadowsocksR`](https://github.com/shadowsocksrr/shadowsocksr-libev)
28 | - [`WireGuard`](https://www.wireguard.com)
29 | - [`Trojan`](https://trojan-gfw.github.io/trojan)
30 | - [`VMess`](https://www.v2fly.org)
31 | - [`VLESS`](https://xtls.github.io)
32 |
33 | ### Others
34 | - UDP NAT FullCone (Limited by your server)
35 | - .NET 6.0 x64
36 |
37 | ## Sponsor
38 |
39 |
40 | ## License
41 | Netch is licensed under the [GPLv3](https://raw.githubusercontent.com/netchx/netch/main/LICENSE) license
42 |
--------------------------------------------------------------------------------
/Netch/Forms/GlobalBypassIPForm.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using Netch.Properties;
3 | using Netch.Utils;
4 |
5 | namespace Netch.Forms;
6 |
7 | [Fody.ConfigureAwait(true)]
8 | public partial class GlobalBypassIPForm : Form
9 | {
10 | public GlobalBypassIPForm()
11 | {
12 | InitializeComponent();
13 | Icon = Resources.icon;
14 | }
15 |
16 | private void GlobalBypassIPForm_Load(object sender, EventArgs e)
17 | {
18 | i18N.TranslateForm(this);
19 |
20 | IPListBox.Items.AddRange(Global.Settings.TUNTAP.BypassIPs.Cast