Security Architecture
// Rate limiting to prevent abuse
const rateLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // requests per IP
standardHeaders: true,
});
// Admin endpoint protection
const adminAuth = (req, res, next) => {
if (req.headers['x-admin-key'] !== process.env.ADMIN_KEY) {
return res.status(403).json({ error: 'Unauthorized' });
}
next();
};Real-time Communication System
Last updated