idk
This commit is contained in:
parent
767d70806a
commit
9244f7f4a4
2 changed files with 8 additions and 4 deletions
|
@ -29,7 +29,7 @@
|
||||||
<section>
|
<section>
|
||||||
<h3>Grab an IP with the link below!</h3>
|
<h3>Grab an IP with the link below!</h3>
|
||||||
<p>
|
<p>
|
||||||
<a href="http://localhost:3030">Grabber Link</a>
|
<a href="http://arrayinamatrix.xyz:3030">Grabber Link</a>
|
||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<p class="aligncenter">
|
<p class="aligncenter">
|
||||||
|
|
|
@ -4,12 +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')
|
||||||
|
|
||||||
console.log("########## IP LOGGER STARTED ##########")
|
let redirectURL = 'http://arrayinamatrix.xyz'
|
||||||
|
let port = 3030
|
||||||
|
console.log(`Redirect: ${redirectURL}`);
|
||||||
|
console.log(`Port: ${port}`)
|
||||||
|
console.log("########## IP LOGGER STARTED ##########");
|
||||||
const app = connect()
|
const app = connect()
|
||||||
.use(requestIp.mw())
|
.use(requestIp.mw())
|
||||||
.use(redirect())
|
.use(redirect())
|
||||||
.use(function (req, res) {
|
.use(function (req, res) {
|
||||||
res.redirect('http://127.0.0.1:3000')
|
res.redirect(redirectURL)
|
||||||
const ip = req.clientIp;
|
const ip = req.clientIp;
|
||||||
console.log(ip);
|
console.log(ip);
|
||||||
file.appendFile("ip-addresses.log", ip + '\n', (e) => {
|
file.appendFile("ip-addresses.log", ip + '\n', (e) => {
|
||||||
|
@ -20,4 +24,4 @@ const app = connect()
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
http.createServer(app).listen(3030);
|
http.createServer(app).listen(port);
|
Loading…
Add table
Reference in a new issue