@@ -42,7 +42,9 @@ const requestListener = function (req, res) {
4242 let intcode = "" + crypto . randomInt ( 999999 ) ;
4343
4444 if ( req . url !== "/favicon.ico" ) {
45- log ( String ( new Date ) + ": " + req . method + " => " + String ( req . url ) )
45+ var ip = req . headers [ 'x-forwarded-for' ] || req . connection . remoteAddress ;
46+
47+ log ( String ( new Date ) + ": " + req . method + " => " + String ( req . url ) + " => User IP: " + ip )
4648
4749 }
4850 if ( req . url === "/test" ) {
@@ -110,7 +112,8 @@ const requestListener = function (req, res) {
110112 //console.log(lines)
111113 /* fs.writeFileSync(intcode, lines); */
112114 //fs.writeFileSync(intcode+".type",type)
113- console . log ( "File uploaded to " + "\x1b[32m" + intcode . replace ( "./data/keys/" , "" ) + "\x1b[37m" + " Type: " + type )
115+
116+ console . log ( "File uploaded to " + "\x1b[32m" + intcode . replace ( "./data/keys/" , "" ) + "\x1b[37m" + " Type: " /*+ type*/ )
114117
115118/*})*/ ;
116119
@@ -128,7 +131,7 @@ console.log("File uploaded to "+"\x1b[32m"+intcode.replace("./data/keys/","")+"\
128131 res . end ( data ) ;
129132 } ) ;
130133
131- } else if ( String ( req . url ) . startsWith ( "/download/" ) && false ) {
134+ } else if ( String ( req . url ) . startsWith ( "/download/" ) ) {
132135 //log(String(req.url).replace("/download/",""))
133136 let pathh = ( String ( req . url ) . replace ( "/download/" , "" ) )
134137 pathh = "./data/keys/" + pathh + ".type"
0 commit comments