-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
You can specify the tun GUID, so the interface will be reused. See https://github.com/xjasonlyu/tun2socks/wiki/Device-Models#options |
Beta Was this translation helpful? Give feedback.
-
|
使用方法建议写详细一些 |
Beta Was this translation helpful? Give feedback.
-
|
问一下大家有没有咋C#上使用的,通过process.Start(),-device tun://Netch?guid={20214AD5-1D95-4CC1-9233-D850D2C9CF9C} -proxy socks5://127.0.0.1:2801 -mtu 1500 -loglevel debug的方式,大家怎么安全结束程序的,我kill程序下次再启用就会提示有一个在,无法启动。 代码 var args = BuildArgs(interfaceName, proxyHost, proxyPort, username, password);
_process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = processPath,
Arguments = args,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
StandardOutputEncoding = Encoding.UTF8,
StandardErrorEncoding = Encoding.UTF8
},
EnableRaisingEvents = true
};
_process.Start()
private static string BuildArgs(string interfaceName, string host, int port, string? username, string? password)
{
var sb = new StringBuilder();
sb.Append($"-device tun://{interfaceName}?guid={{20214AD5-1D95-4CC1-9233-D850D2C9CF9C}} ");
// SOCKS5
sb.Append("-proxy socks5://");
if (!string.IsNullOrEmpty(username))
{
sb.Append($"{username}:{password}@");
}
sb.Append($"{host}:{port} ");
sb.Append("-mtu 1500 ");
sb.Append("-loglevel debug ");
return sb.ToString();
}日志 |
Beta Was this translation helpful? Give feedback.


You can specify the tun GUID, so the interface will be reused. See https://github.com/xjasonlyu/tun2socks/wiki/Device-Models#options