testing bug fix

This commit is contained in:
sairaj mote 2024-01-16 04:23:34 +05:30
parent ea72f31cc6
commit 4253679c49
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ const axios = require('axios');
router.get('/', async (req, res) => {
try {
const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress;
const ip = req.socket.remoteAddress;
const response = await axios.get(`https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=${ip}`);
const isTor = response.data.includes(ip);
res.json({ isTor, ip });

View File

@ -1 +1 @@
const express=require("express"),router=express.Router(),axios=require("axios");router.get("/",(async(req,res)=>{try{const ip=req.headers["x-forwarded-for"]||req.socket.remoteAddress,isTor=(await axios.get(`https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=${ip}`)).data.includes(ip);res.json({isTor:isTor,ip:ip})}catch(error){res.status(500).json({error:error.message})}})),module.exports=router;
const express=require("express"),router=express.Router(),axios=require("axios");router.get("/",(async(req,res)=>{try{const ip=req.socket.remoteAddress,isTor=(await axios.get(`https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=${ip}`)).data.includes(ip);res.json({isTor:isTor,ip:ip})}catch(error){res.status(500).json({error:error.message})}})),module.exports=router;