ip logger works now

This commit is contained in:
array-in-a-matrix 2022-02-03 01:03:58 +00:00
parent 2ae6af38e0
commit 93b765db37
2 changed files with 10 additions and 13 deletions

View file

@ -29,11 +29,11 @@
<section> <section>
<h3>Grab an IP with the link below!</h3> <h3>Grab an IP with the link below!</h3>
<p> <p>
<a href="arrayinamatrix.xyz:3030">Grabber Link</a> <a href="http://surprise.arrayinamatrix.xyz">Grabber Link</a>
</p> </p>
<br> <br>
<p class="aligncenter"> <p class="aligncenter">
<img src="/res/site/images/trollface.gif" alt="You mad bro?, Problem" /> <img src="/res/site/images/trollface.gif" alt="You mad bro?, Problem?" />
</p> </p>
</section> </section>
<!-- <section> --> <!-- <section> -->

View file

@ -4,17 +4,16 @@ const file = require('fs');
const requestIp = require('request-ip'); const requestIp = require('request-ip');
const redirect = require('connect-redirection') const redirect = require('connect-redirection')
var httpsOptions = { let redirectURL = 'https://arrayinamatrix.xyz'
key: fs.readFileSync('/path/to/HTTPS/server-key.pem'), if (process.argv[2] != undefined) {
cert: fs.readFileSync('/path/to/HTTPS/server-crt.pem') redirectURL = process.argv[2]
}; }
let redirectURL = 'http://arrayinamatrix.xyz' let httpPort = 3030
let http_port = 3030
let https_port = 3031
console.log(`Redirect: ${redirectURL}`); console.log(`Redirect: ${redirectURL}`);
console.log(`Port: ${http_port}`) console.log(`Port: ${httpPort}`)
console.log("########## IP LOGGER STARTED ##########"); console.log("########## IP LOGGER STARTED ##########");
const app = connect() const app = connect()
.use(requestIp.mw()) .use(requestIp.mw())
.use(redirect()) .use(redirect())
@ -27,8 +26,6 @@ const app = connect()
console.log(e); console.log(e);
}; };
}); });
}); });
http.createServer(app).listen(http_port); http.createServer(app).listen(httpPort);
https.createServer(httpsOptions, app).listen(https_port);