Forum Moderators: coopster

Message Too Old, No Replies

Passthru response from an executable - with delay

         

davidpbrown

12:40 pm on May 2, 2020 (gmt 0)

10+ Year Member



What script can passthru the full response from an executable, which might be slightly delayed responding?..

The executable I’m looking to fetches a webpage and I want that passed to the browser, as the full response.

This should be simple but hitting the edge of what I know.
Here defaulting to expecting php can handle this… but open to any robust solution.

What I have so far works, for what is a prompt response on the Version detail but then not the useful response, which atm is slightly delayed. So, wanting the php to hold until received.

This a dirty cluster of me guessing everything I know…


<#php
ob_start();
?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>
<#php
passthru("./safe -V");
echo "</p><p>";
passthru("./safe cat safe://hello/index.html");
?>
</p>
</body>
</html><#php
$size=ob_get_length();
header("Content-Length: $size");
ob_end_flush();
?>

(forum code tags struggling with basic php tags! - replace the # with ? )

but the output is simply the version answer and not the other content.

safe-cli 0.12.0


My interest here centered on the SAFE network CLI from [github.com...]
Current copy listed on assets at [github.com...]

and I have that executable then in /var/www space and given it works for -V access to that not the issue but the delay handling is?..

#offtopic Motivation is that I wonder this would allow safe://website.somedomain to be accessible as h#tp://website.somedomain and a powerful option then going forward, with body content in SAFE and header fixing the http visibility. See [safenetwork.tech...] for more of what this is.

Point above, still is relative to any executable that is delayed?.. how do I get php to wait?.. timeout isn’t working and seems like the wrong direction to look; so, what other options…

davidpbrown

8:30 pm on May 4, 2020 (gmt 0)

10+ Year Member



Noting it seems perhaps this is likely more easily done with perl.