<?php
// cam_barzio.php
$cam = isset($_GET['cam']) ? $_GET['cam'] : 'Cam1';
// Sostituisci se Blue Iris richiede user/pass (es: http://user:pass@100.122.26.83:8090...)
$url = "http://100.122.26.83:8090/image/" . $cam;

$opts = array(
    'http' => array(
        'method' => "GET",
        'header' => "User-Agent: Mozilla/5.0\r\n"
    )
);

$context = stream_context_create($opts);
$image = @file_get_contents($url, false, $context);

if ($image !== FALSE) {
    header('Content-Type: image/jpeg');
    header('Cache-Control: no-cache, no-store, must-revalidate');
    echo $image;
} else {
    header("HTTP/1.0 404 Not Found");
}
?>