working defaults
This commit is contained in:
@@ -2940,10 +2940,15 @@ func main() {
|
||||
deploymentFlag := flag.String("deployment-id", DefaultDeploymentID, "x-deployment-id header value")
|
||||
clientContextFlag := flag.String("client-context", DefaultClientContext, "x-client-context header value")
|
||||
browserBinFlag := flag.String("browser-bin", "", "Custom path to Chromium/Chrome binary for auto-capture")
|
||||
autoCaptureFlag := flag.Bool("auto-capture", false, "Automatically bridge requests and auto-generate fresh hCaptcha tokens via Chromium")
|
||||
autoCaptureFlag := flag.Bool("auto-capture", true, "Automatically bridge requests and auto-generate fresh hCaptcha tokens via Chromium (default true)")
|
||||
directFlag := flag.Bool("direct", false, "Disable browser bridge and run in direct HTTP client mode")
|
||||
noBridgeFlag := flag.Bool("no-bridge", false, "Disable browser bridge (alias for -direct)")
|
||||
noAutoCaptureFlag := flag.Bool("no-auto-capture", false, "Disable browser bridge (alias for -direct)")
|
||||
headlessFlag := flag.Bool("headless", false, "Force strict headless mode (defaults to offscreen window if display is available)")
|
||||
displayFlag := flag.String("display", "", "Custom X11 DISPLAY to run browser on (e.g. :99 for Xvfb / Xephyr / Xnest)")
|
||||
xvfbFlag := flag.Bool("xvfb", false, "Automatically spawn and manage an isolated virtual X server (Xvfb) for headless tiling WM environments")
|
||||
xvfbFlag := flag.Bool("xvfb", true, "Automatically spawn and manage an isolated virtual X server (Xvfb) for headless tiling WM environments (default true)")
|
||||
xvfbUpperFlag := flag.Bool("Xvfb", false, "Alias for -xvfb")
|
||||
noXvfbFlag := flag.Bool("no-xvfb", false, "Disable automatic virtual X server (use active DISPLAY)")
|
||||
uaFlag := flag.String("user-agent", DefaultUserAgent, "User-Agent header to send upstream")
|
||||
uaShortFlag := flag.String("ua", "", "Alias for -user-agent")
|
||||
flag.Parse()
|
||||
@@ -2954,6 +2959,19 @@ func main() {
|
||||
ConfiguredUserAgent = *uaFlag
|
||||
}
|
||||
|
||||
effectiveAutoCapture := *autoCaptureFlag
|
||||
if *directFlag || *noBridgeFlag || *noAutoCaptureFlag {
|
||||
effectiveAutoCapture = false
|
||||
}
|
||||
|
||||
effectiveXvfb := *xvfbFlag
|
||||
if *xvfbUpperFlag {
|
||||
effectiveXvfb = true
|
||||
}
|
||||
if *noXvfbFlag {
|
||||
effectiveXvfb = false
|
||||
}
|
||||
|
||||
gateway := NewT3Gateway(
|
||||
*targetURLFlag,
|
||||
*clientContextFlag,
|
||||
@@ -2962,13 +2980,13 @@ func main() {
|
||||
*hcaptchaFlag,
|
||||
*defaultModelFlag,
|
||||
*browserBinFlag,
|
||||
*autoCaptureFlag,
|
||||
effectiveAutoCapture,
|
||||
*headlessFlag,
|
||||
*displayFlag,
|
||||
*xvfbFlag,
|
||||
effectiveXvfb,
|
||||
)
|
||||
|
||||
if *autoCaptureFlag {
|
||||
if effectiveAutoCapture {
|
||||
fmt.Println("Initializing private browser bridge (TLS & dynamic hCaptcha generator)...")
|
||||
if err := gateway.bridge.Start(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "warning: browser bridge init failed: %v (falling back to direct client)\n", err)
|
||||
@@ -3008,7 +3026,8 @@ func main() {
|
||||
fmt.Printf("th3ist gateway starting on port %s...\n", *portFlag)
|
||||
fmt.Printf("Default Model: %s\n", *defaultModelFlag)
|
||||
fmt.Printf("Upstream: %s\n", *targetURLFlag)
|
||||
fmt.Printf("Auto-Capture / Bridge: %t\n", *autoCaptureFlag)
|
||||
fmt.Printf("Auto-Capture / Bridge: %t\n", effectiveAutoCapture)
|
||||
fmt.Printf("Virtual X Display (Xvfb): %t\n", effectiveXvfb)
|
||||
fmt.Printf("Endpoints:\n")
|
||||
fmt.Printf(" GET http://localhost:%s/v1/models\n", *portFlag)
|
||||
fmt.Printf(" POST http://localhost:%s/v1/chat/completions\n", *portFlag)
|
||||
|
||||
Reference in New Issue
Block a user