- Add settings menu to switch between Xray and V2Ray cores for VLESS connections - Implement core type persistence in configuration with LoadSettings/SaveSettings - Add VLESS error and access log viewer showing last 30 and 20 lines respectively - Display current core type and system time in main menu - Update VLESS connection to use selected core dynamically - Refactor monitor.go to accept 'q' key input for graceful exit instead of signal handling - Add proxy platform-specific implementations (proxy_unix.go, proxy_windows.go) - Add downloader module for managing binary resources - Include V2Ray and Xray configuration files and geodata (geoip.dat, geosite.dat) - Update CLI imports to include path/filepath and time packages - Improve user experience with core selection visibility and log diagnostics
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package main
|
||
|
||
import (
|
||
"fmt"
|
||
"os"
|
||
|
||
"vpn-client/internal/admin"
|
||
"vpn-client/internal/cli"
|
||
"vpn-client/internal/config"
|
||
"vpn-client/internal/downloader"
|
||
)
|
||
|
||
func main() {
|
||
// Проверка прав администратора
|
||
admin.RequireAdmin()
|
||
|
||
// Инициализация конфигурации
|
||
if err := config.Init(); err != nil {
|
||
fmt.Fprintf(os.Stderr, "Ошибка инициализации: %v\n", err)
|
||
os.Exit(1)
|
||
}
|
||
|
||
// Проверка и загрузка Xray и V2Ray
|
||
fmt.Println("Проверка наличия Xray и V2Ray...")
|
||
if err := downloader.CheckAndDownloadBoth(config.XrayDir, config.V2RayDir); err != nil {
|
||
fmt.Fprintf(os.Stderr, "Ошибка загрузки ядер: %v\n", err)
|
||
fmt.Println("\nНажмите Enter для выхода...")
|
||
fmt.Scanln()
|
||
os.Exit(1)
|
||
}
|
||
|
||
// Запуск CLI
|
||
if err := cli.Run(); err != nil {
|
||
fmt.Fprintf(os.Stderr, "Ошибка: %v\n", err)
|
||
fmt.Println("\nНажмите Enter для выхода...")
|
||
fmt.Scanln()
|
||
os.Exit(1)
|
||
}
|
||
|
||
// Нормальный выход
|
||
os.Exit(0)
|
||
}
|