<?php
use boru\borumcp\Logger\FileLogger;
use boru\borumcp\Proxy\HttpProxyApp;
use boru\borumcp\Proxy\ProxyConfig;

require __DIR__ . '/../vendor/autoload.php';

/*
$proxy = (new \boru\borumcp\HttpProxyController())
    ->upstreamHost('127.0.0.1')
    ->allowedPortRange(8000, 65000)
    ->internalPortHeader('internal-port')
    ->timeouts(3.0, 2.0, 4000, 4000, 10000);

$proxy->handle();
*/

$cfg = (new ProxyConfig())
    ->upstreamHost('127.0.0.1')
    ->allowedPortRange(8000, 65000)
    ->internalPortHeader('internal-port')
    ->timeouts(3.0, 2.0, 6000, 6000, 12000)   // roomier for WAN hops
    ->protocolVersion('2025-06-18');
    //->logger(new FileLogger(__DIR__."/mcplog.log"));

$app = new HttpProxyApp($cfg);
$app->handle();