Repository navigation
# 🚀 HeadlessX v1.1.0
Release Date: September 12, 2025
Version: 1.1.0
Codename: "Unified Architecture"
🎯 What's New
🌐 Unified Architecture
- Single Domain Solution: Website and API now run on the same domain
- Integrated Server: One Node.js server handles both frontend and backend
- Seamless User Experience: No more separate domains for website and API
🧠 Advanced Human-like Behavior
- 40+ Anti-Detection Techniques: Enhanced stealth capabilities
- Realistic User Agent Rotation: Windows-focused browser agents
- Natural Mouse Movements: Human-like interaction patterns
- Smart Scrolling: Behavioral randomization for better detection avoidance
- Browser-Specific Headers: Chrome, Edge, and Firefox header simulation
🔒 Production-Ready Infrastructure
- Docker Support: Complete containerization with docker-compose
- PM2 Integration: Professional process management
- Nginx Configuration: Load balancing and rate limiting
- SSL Ready: Automatic HTTPS setup with certbot
- Rate Limiting: API protection with zone-based limits
📊 Enhanced API Capabilities
- Multiple Output Formats: HTML, text, screenshots, PDFs
- Batch Processing: Handle multiple URLs efficiently
- Advanced Rendering Options: Wait conditions, timeouts, user agents
- Cookie Support: Session management and authentication
- Comprehensive Error Handling: Detailed error responses
✨ Key Features
🌐 Unified Web Architecture
Before v1.1.0:
├── Website: yourdomain.com (separate)
└── API: api.yourdomain.com (separate)
After v1.1.0:
└── All-in-One: headlessx.yourdomain.com
├── / (website)
└── /api/* (API endpoints)
🛡️ Enhanced Security
- Token-based Authentication: Secure API access
- Rate Limiting: Multiple zones (health, API, website)
- Security Headers: X-Frame-Options, CSP, XSS protection
- Input Validation: Comprehensive request validation
- Error Sanitization: Safe error responses
🚀 Deployment Options
- 🐳 Docker:
docker-compose up -d - 🔧 Node.js + PM2:
sudo ./scripts/setup.sh - 💻 Development:
npm start
📋 Complete Feature List
🔧 API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check (no auth) |
/api/status |
GET | Server status |
/api/render |
POST | Full page rendering (JSON) |
/api/html |
GET/POST | Raw HTML extraction |
/api/content |
GET/POST | Clean text extraction |
/api/screenshot |
GET | Screenshot generation |
/api/pdf |
GET | PDF generation |
/api/batch |
POST | Batch URL processing |
🧠 Human Behavior Features
- User Agent Rotation: Chrome 126-128, Edge 127-128, Firefox 128-129
- Realistic Headers: Browser-specific header sets
- Mouse Movements: Natural cursor patterns
- Scroll Simulation: Human-like page navigation
- Timing Randomization: Variable delays and timeouts
- Viewport Simulation: Multiple screen resolutions
🔒 Security & Performance
- Rate Limiting: 10r/s API, 100r/s health, 30r/s website
- Request Validation: URL, timeout, and parameter validation
- Memory Management: Automatic browser cleanup
- Error Handling: Graceful degradation
- Logging: Comprehensive request/error logging
🛠️ Installation & Setup
Quick Start
# Clone repository
git clone https://github.com/SaifyXPRO/HeadlessX.git
cd HeadlessX
# Quick setup
chmod +x scripts/quick-setup.sh && ./scripts/quick-setup.sh
nano .env # Configure DOMAIN, SUBDOMAIN, TOKEN
# Choose deployment method:
docker-compose up -d # Docker (recommended)
sudo ./scripts/setup.sh # Auto setup
npm install && npm start # DevelopmentEnvironment Configuration
# Required .env variables
TOKEN=your_secure_token_here
DOMAIN=yourdomain.com
SUBDOMAIN=headlessx
# Optional settings
PORT=3000
NODE_ENV=production
BROWSER_TIMEOUT=60000
MAX_CONCURRENT_BROWSERS=5Domain Setup
# DNS Record (A record)
headlessx.yourdomain.com → YOUR_SERVER_IP
# Automatic nginx configuration
sudo ./scripts/setup.sh
# Manual nginx setup
sudo sed -i 's/SUBDOMAIN.DOMAIN.COM/headlessx.yourdomain.com/g' /etc/nginx/sites-available/headlessx🔄 Migration from v1.0.x
Breaking Changes
- Unified Architecture: Website and API now share the same domain
- New Environment Variables:
DOMAINandSUBDOMAINrequired - Updated Nginx Config: New configuration with rate limiting
- PM2 Configuration: Enhanced process management setup
Migration Steps
-
Update Environment:
cp .env.example .env # Add DOMAIN and SUBDOMAIN variables -
Update Nginx:
sudo cp nginx/headlessx.conf /etc/nginx/sites-available/headlessx sudo sed -i 's/SUBDOMAIN.DOMAIN.COM/your.domain.com/g' /etc/nginx/sites-available/headlessx -
Restart Services:
pm2 restart all sudo systemctl reload nginx
🧪 Testing & Validation
Health Checks
# Basic health check
curl http://headlessx.yourdomain.com/api/health
# Server status (requires token)
curl "http://headlessx.yourdomain.com/api/status?token=YOUR_TOKEN"
# Website access
curl http://headlessx.yourdomain.comAPI Testing
# HTML extraction
curl -X POST "http://headlessx.yourdomain.com/api/html?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
# Screenshot generation
curl "http://headlessx.yourdomain.com/api/screenshot?url=https://example.com&token=YOUR_TOKEN" \
--output screenshot.png📊 Performance & Specifications
System Requirements
- OS: Ubuntu 20.04+ (recommended), Ubuntu 24.04+, Ubuntu 25.04+
- Node.js: 20.x LTS
- RAM: 2GB minimum, 4GB recommended
- Storage: 2GB free space
- Network: Public IP with domain pointing
Performance Metrics
- Response Time: <500ms for simple requests
- Throughput: 100+ requests/minute
- Memory Usage: ~200MB base, +50MB per browser instance
- Browser Startup: <2 seconds
- Screenshot Generation: <3 seconds
Scalability
- Concurrent Browsers: 5 (configurable)
- Rate Limits: Configurable per zone
- Load Balancing: Nginx reverse proxy
- Process Management: PM2 cluster mode ready
🐛 Bug Fixes
v1.1.0 Fixes
- Fixed nginx configuration conflicts with rate limiting
- Resolved Ubuntu 25.04 package dependency issues
- Fixed duplicate proxy settings in nginx config
- Corrected Playwright browser installation on modern Ubuntu
- Fixed PM2 auto-start configuration
- Resolved script permission issues
- Fixed environment variable loading
Known Issues
- Playwright may require manual dependency installation on some Ubuntu versions
- SSL certificate renewal requires manual certbot setup
- Large PDF generation may timeout (use higher timeout values)
🔧 Scripts & Tools
Available Scripts
scripts/setup.sh # Complete automated setup
scripts/setup-playwright.sh # Playwright-specific setup
scripts/quick-setup.sh # Initial setup (permissions + .env)
scripts/test-routing.sh # Integration testing
scripts/verify-domain.sh # Domain verification
scripts/validate-setup.sh # Installation validation
scripts/generate-lockfiles.sh # Package lock generationNPM Scripts
npm start # Development server
npm run build # Build website
npm run pm2:start # Start with PM2
npm run pm2:stop # Stop PM2 processes
npm run pm2:restart # Restart PM2 processes
npm run pm2:logs # View PM2 logs
npm run pm2:status # Check PM2 status
npm run setup-playwright # Setup Playwright browsers
npm run validate # Validate installation📚 Documentation
Available Documentation
README.md- Main documentation and setup guidedocs/GET_ENDPOINTS.md- GET API endpoints referencedocs/POST_ENDPOINTS.md- POST API endpoints referencedocs/HUMAN_BEHAVIOR_UPDATE.md- Human behavior featuresDEPLOYMENT.md- Detailed deployment guideCONTRIBUTING.md- Contribution guidelinesPROJECT_STRUCTURE.md- Project architecture
Configuration Files
nginx/headlessx.conf- Nginx configuration templateconfig/ecosystem.config.js- PM2 configurationdocker/docker-compose.yml- Docker setup.env.example- Environment template
🤝 Contributing
We welcome contributions! Please see:
CONTRIBUTING.mdfor contribution guidelines- GitHub Issues for bug reports
- GitHub Discussions for feature requests
Development Setup
git clone https://github.com/SaifyXPRO/HeadlessX.git
cd HeadlessX
npm install
cd website && npm install && npm run build && cd ..
cp .env.example .env
npm start📄 License
HeadlessX v1.1.0 is released under the MIT License.
🙏 Acknowledgments
- Playwright Team - For the excellent browser automation framework
- Next.js Team - For the powerful React framework
- Express.js Community - For the robust web framework
- PM2 Team - For process management excellence
- Community Contributors - For feedback and testing
📞 Support
- GitHub Issues: Report bugs
- Documentation: Full docs
- Email: Contact maintainer
Happy scraping with HeadlessX v1.1.0! 🚀
Built with ❤️ by the HeadlessX team