#!%NODE_EXECUTABLE_PATH% var CgiNodeConfig={Version:"0.2",StartTag:"'+a+"");for(var c in d){var f=d[c];if("function"!==typeof f){if("object"===typeof f){var k='',l;for(l in f)k+="";f=k+"
"+l+""+f[l]+"
"}process.stdout.write(""+ c+""+f+"")}}};b.response.write("");b.response.write('');var d={id:b.session.id,path:b.session.path,ipAddress:b.session.ipAddress};a("CGI Command Line Arguments", process.argv);a("Server Variables",b.request.server);a("HTTP Request Headers",b.request.headers);a("HTTP Request Cookies",b.request.cookies);a("Session",d);a("Session Cookies",b.session.cookies);a("Session Data",b.session.data);a("URL Query String",b.request.query);a("Post Form",b.request.post.form);a("Post Files",b.request.post.files);a("Post Parts",b.request.post.parts);b.response.write("
")}} function CgiHttpSession(a,b){var c=this;this.ipAddress=this.path=this.id=null;this.cookies={};this.data={};this.init=function(){a.session=this;b.session=this;this.id=a.cookies.hasOwnProperty(CgiNodeConfig.SessionCookie)?a.cookies[CgiNodeConfig.SessionCookie]:this.create();var d=Path.join(CgiNodeConfig.SessionPath,this.id);FS.existsSync(d)||(this.id=this.create());d=JSON.parse(FS.readFileSync(Path.join(CgiNodeConfig.SessionPath,this.id)));if(d.ipAddress!=a.server.remote_addr)throw"Invalid session ID!"; for(name in d)this[name]=d[name]};this.save=function(){FS.writeFileSync(c.path,JSON.stringify({id:c.id,path:c.path,ipAddress:c.ipAddress,cookies:c.cookies,data:c.data}))};this.create=function(){var b=a.server.remote_addr+a.server.remote_port+a.server.unique_id+(new Date).value+Math.random(),b=Crypto.createHash("md5").update(b).digest("hex"),c={id:b,path:Path.join(CgiNodeConfig.SessionPath,b),ipAddress:a.server.remote_addr,cookies:{},data:{}};c.cookies[CgiNodeConfig.SessionCookie]={name:CgiNodeConfig.SessionCookie, value:b,httpOnly:!0,notSent:!0,server:!0};FS.writeFileSync(c.path,JSON.stringify(c));return c.id};this.cleanUp=function(){for(var a=(new Date).value,b=1E3*CgiNodeConfig.SessionTimeOut,c=FS.readdirSync(CgiNodeConfig.SessionPath),h=0;he&&(a.code+=d+a.content.length+"]);",a.content.push(c.slice(e,b)));var e=b+2,g="="==c[e]?e++:-1;b=c.indexOf("?>",e);if(0<=b)a.code=0");}else b=c.length,a.code+=d+a.content.length+"]);",a.content.push(c.slice(e, b));return a},enviromentVarialbesAndHeaders:function(a,b,c){for(var d in a){var e=a[d];d=d.toLowerCase();0===d.indexOf("http_")?c[d.substring(5)]=e:b[d]=e}},multiPart:function(a,b){void 0===b&&(b={form:{},files:{},parts:[]});var c=0,c=a.indexOf("\n"),c=a.substring(0,c-1);b.parts=a.split(c);for(c=0;ce)){var g=d.substr(0,e).trim(),d=d.substr(e+1,d.length).trim();'"'==d[0]&&(d=d.slice(1,-1));try{b[g]=decodeURIComponent(d)}catch(h){b[g]=d}}}return b}},VM=require("vm"),FS=require("fs"),URL=require("url"),Path=require("path"),Crypto=require("crypto"),QueryString=require("querystring"),cgiNodeContext=null; process.on("uncaughtException",function(a){a='
EXCEPTION: '+a.message+"
"+a.stack+"

";null!==cgiNodeContext?cgiNodeContext.response.write(a):process.stdout.write("Content-type: text/html; charset=iso-8859-1\n\n"+a)});process.on("exit",function(a){cgiNodeContext.session.save();cgiNodeContext.session.cleanUp()});var cgiNodeContext=new CgiHttpContext,onReady=function(){cgiNodeContext.include(process.env.PATH_TRANSLATED)}; "POST"!=cgiNodeContext.request.method&&"PUT"!=cgiNodeContext.request.method?onReady():cgiNodeContext.request.readPost(onReady);