Created
November 2, 2014 23:41
-
-
Save zwetan/1bb76228478885845623 to your computer and use it in GitHub Desktop.
debugging CGI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
import C.stdio.*; | |
import flash.utils.ByteArray; | |
function write( message:String = "" ):void | |
{ | |
var bytes:ByteArray = new ByteArray(); | |
bytes.writeUTFBytes( message ); | |
bytes.position = 0; | |
fwrite( bytes, bytes.length, stdout ); | |
fflush( stdout ); | |
} | |
write( "Content-type: text/html\n\n" ); | |
write( "Hello, World." ); | |
} | |
catch( e:Error ) | |
{ | |
trace( "Content-type: text/html\n\n" ); | |
trace( e.getStackTrace() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment