mirror of
https://github.com/YuzuZensai/Test-IP.git
synced 2026-07-21 15:19:28 +00:00
13 lines
274 B
JavaScript
13 lines
274 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
|
|
app.get("/", (req, res) => {
|
|
const ip = req.headers["x-forwarded-for"] || req.socket.remoteAddress;
|
|
res.send(ip);
|
|
res.end();
|
|
});
|
|
|
|
app.listen(3000, () => {
|
|
console.log("Listening on port 3000");
|
|
});
|