experimental/windivert: P2.1+P2.2 with WinDivert NETWORK+SOCKET layers
WIP snapshot before pivot to sing-box+TUN. Reached: - TCP redirect via streamdump pattern (swap+Outbound=0+reinject) - SOCKET layer for SYN-stage flow detection (avoids FLOW Establish-too-late race) - Lazy PID→name resolution (catches Update.exe inside procscan tick) - UDP forward via SOCKS5 UDP ASSOCIATE relay + manual reinject - Result: chat works, voice times out (Discord IP discovery / RTC handshake fails) Reason for pivot: WinDivert NAT-reinject pattern has subtle layer-3 semantics issues that DLL-injection / TUN-based proxies sidestep entirely. Going with embedded sing-box + wintun as the engine — proven path for Discord voice through SOCKS5. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ package gui
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -175,9 +176,11 @@ func (a *App) CancelCheck() {
|
||||
|
||||
// StartEngine initializes and brings up the engine with the given config.
|
||||
func (a *App) StartEngine(cfg Config) error {
|
||||
log.Printf("gui: StartEngine called host=%s port=%d auth=%v", cfg.Host, cfg.Port, cfg.Auth)
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
if a.eng != nil && a.eng.Status() == engine.StatusActive {
|
||||
log.Printf("gui: StartEngine no-op (already active)")
|
||||
return nil
|
||||
}
|
||||
e, err := engine.New(engine.Config{
|
||||
@@ -188,15 +191,18 @@ func (a *App) StartEngine(cfg Config) error {
|
||||
Targets: []string{"Discord.exe", "DiscordCanary.exe", "DiscordPTB.exe", "Update.exe"},
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("gui: engine.New failed: %v", err)
|
||||
runtime.EventsEmit(a.ctx, "engine:status", map[string]any{"running": false, "error": err.Error()})
|
||||
return err
|
||||
}
|
||||
if err := e.Start(a.ctx); err != nil {
|
||||
log.Printf("gui: engine.Start failed: %v", err)
|
||||
runtime.EventsEmit(a.ctx, "engine:status", map[string]any{"running": false, "error": err.Error()})
|
||||
return err
|
||||
}
|
||||
a.eng = e
|
||||
a.startedAt = time.Now()
|
||||
log.Printf("gui: engine started, status=%s", e.Status())
|
||||
runtime.EventsEmit(a.ctx, "engine:status", map[string]any{"running": true})
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user