. */ if(file_exists("ttntunnel-out.ini") && is_readable("ttntunnel-out.ini")) { $config = parse_ini_file("ttntunnel-out.ini"); } if(isset($config['logfile'])) { error_reporting(E_ALL | E_STRICT); ini_set("error_log", $config['logfile']); } $peer = $config['peer']; $port = $config['port']; if(isset($_POST['buf'])) { $buf = base64_decode($_POST['buf']); $socket = stream_socket_client("udp://$peer:$port", $errno, $errstr); $socket_name = stream_socket_get_name($socket, FALSE); if (!$socket) { error_log("ERROR: $errno - $errstr"); } else { fwrite($socket, $buf); $response = fread($socket, 32768); $response = base64_encode($response); fclose($socket); echo $response; } }