mirror of
https://github.com/netchx/netch.git
synced 2026-03-16 17:53:17 +08:00
40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Netch.Models;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Netch.Controllers
|
|
{
|
|
public class TrojanController : EncryptedProxy
|
|
{
|
|
public TrojanController()
|
|
{
|
|
Name = "Trojan";
|
|
MainFile = "Trojan.exe";
|
|
StartedKeywords.Add("started");
|
|
StoppedKeywords.Add("exiting");
|
|
}
|
|
|
|
public override bool Start(Server server, Mode mode)
|
|
{
|
|
File.WriteAllText("data\\last.json", JsonConvert.SerializeObject(new Trojan
|
|
{
|
|
local_addr = LocalAddress,
|
|
local_port = Socks5LocalPort,
|
|
remote_addr = server.Hostname,
|
|
remote_port = server.Port,
|
|
password = new List<string>
|
|
{
|
|
server.Password
|
|
}
|
|
}));
|
|
|
|
return StartInstanceAuto("-c ..\\data\\last.json");
|
|
}
|
|
|
|
public override void Stop()
|
|
{
|
|
StopInstance();
|
|
}
|
|
}
|
|
} |