Reputation: 73
I need to have debugging/logging information for a flash video player.
I need to display the client ip, along with the server ip of the stream... can this be done?
example stream: (actually it's a manifest that, upon load, retrieves the stream) http://multiplatform-f.akamaihd.net/z/multi/april11/hdworld/hdworld_,512x288_450_b,640x360_700_b,768x432_1000_b,1024x576_1400_m,1280x720_1900_m,1280x720_2500_m,1280x720_3500_m,.mp4.csmil/manifest.f4m
Techs available to me: Javascript, AS3 FLASH. basically a "whatsmyip" and a reverse ip lookup through flash/javascript.... possible without server side scripts?
Upvotes: 2
Views: 492
Reputation: 1055
Get client IP with JS:
<script type="text/javascript">
function getip(data){
alert(data.ip);
}
</script>
<script type="text/javascript" src="http://jsonip.appspot.com/?callback=getip">
</script>
Or with php:
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
Get server IP only with server side script, like php:
<?php
$ip = gethostbyname('www.example.com');
echo $ip;
?>
Upvotes: 2