LumaTunnel
【WinUI】LumaTunnel 是一个面向个人多设备的 Windows 代理系统。客户端在本机提供 HTTP/HTTPS CONNECT 与 SOCKS5 TCP 代理,并通过一个受信任 TLS 证书保护的 WSS 会话,将多个 TCP 流复用到自建 Windows Server 节点。
关注
0
Fork
0
Star
0
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace LumaTunnel.Client.Views;
public sealed partial class ConnectionsPage : Page
{
private DispatcherTimer? _timer;
public ConnectionsPage() => InitializeComponent();
private void OnLoaded(object sender, RoutedEventArgs e)
{
_timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
_timer.Tick += (_, _) => Refresh();
_timer.Start();
Refresh();
}
private void OnUnloaded(object sender, RoutedEventArgs e) => _timer?.Stop();
private void Refresh() => ConnectionList.ItemsSource = AppServices.ProxyEngine.Connections
.OrderByDescending(static item => item.StartedAtUtc)
.Select(item => $"{item.Protocol,-7} {item.Target,-40} {item.Route,-7} ↑ {item.UploadBytes} ↓ {item.DownloadBytes}")
.ToArray();
}
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace LumaTunnel.Client.Views;
public sealed partial class ConnectionsPage : Page
{
private DispatcherTimer? _timer;
public ConnectionsPage() => InitializeComponent();
private void OnLoaded(object sender, RoutedEventArgs e)
{
_timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1) };
_timer.Tick += (_, _) => Refresh();
_timer.Start();
Refresh();
}
private void OnUnloaded(object sender, RoutedEventArgs e) => _timer?.Stop();
private void Refresh() => ConnectionList.ItemsSource = AppServices.ProxyEngine.Connections
.OrderByDescending(static item => item.StartedAtUtc)
.Select(item => $"{item.Protocol,-7} {item.Target,-40} {item.Route,-7} ↑ {item.UploadBytes} ↓ {item.DownloadBytes}")
.ToArray();
}