Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hendrywang/Naiveproxy_Neo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Naiveproxy NEO

🚀 One-click deployment script for Naiveproxy with Caddy2 - Advanced proxy solution for secure internet access

License: MIT Shell Script Platform Buy Me A Coffee

English | 简体中文


📋 Table of Contents


🌟 Overview

Naiveproxy NEO is a powerful, automated deployment script for setting up Naiveproxy with Caddy2. It provides a secure, high-performance proxy solution that resists traffic analysis and detection through advanced obfuscation techniques.

What is Naiveproxy?

Naiveproxy is a proxy built on Chrome's network stack to camouflage traffic as standard HTTPS connections. It leverages Caddy's forwardproxy plugin to provide:

  • Undetectable Traffic: Mimics genuine Chrome browser traffic
  • Probe Resistance: Resists active probing attempts
  • TLS Fingerprinting Protection: Uses real Chrome TLS implementation
  • High Performance: Built on efficient HTTP/2 and QUIC protocols

Why NEO?

This script automates the entire setup process, making it accessible even for users without Linux expertise:

  • ✅ Fully automated installation and configuration
  • ✅ Interactive, user-friendly interface with clear prompts
  • ✅ Automatic SSL/TLS certificate management via ACME
  • ✅ Multi-port multiplexing support
  • ✅ One-command deployment and management
  • ✅ Built-in QR code generation for easy client setup

✨ Features

🔧 Core Features

  • One-Click Installation: Complete deployment in minutes
  • Automatic Dependencies: Handles all package installations
  • SSL Certificate Automation: Integrates ACME for free SSL certificates
  • Multi-Distribution Support: Works on Ubuntu, Debian, and CentOS
  • Architecture Support: Compatible with x86_64 (amd64) and ARM64 processors

🛡️ Security Features

  • Automatic Firewall Management: Configures necessary ports
  • Random Credential Generation: Secure default username/password
  • TLS 1.3 Support: Uses latest encryption standards
  • Probe Resistance: Built-in protection against active probing
  • IP/Via Header Hiding: Enhanced privacy protection

⚡ Advanced Features

  • Multi-Port Multiplexing: Run proxy on multiple ports simultaneously
  • Custom Masquerade Website: Disguise proxy as legitimate web server
  • IPv6 Support: Full IPv6 compatibility with DNS64
  • OpenVZ/LXC Support: Special handling for virtualized environments
  • Service Management: Easy start/stop/restart controls
  • Real-time Logs: Built-in log viewer for troubleshooting

📱 Client Support

  • V2rayN: Auto-generated JSON configuration
  • Nekobox: QR code generation for mobile setup
  • Direct Configuration: Manual setup guides available

💻 System Requirements

Supported Operating Systems

Distribution Versions Status
Ubuntu 18.04, 20.04, 22.04, 24.04 ✅ Fully Supported
Debian 10, 11, 12 ✅ Fully Supported
CentOS 7, 8 ✅ Fully Supported

Supported Architectures

  • x86_64 (amd64)
  • aarch64 (ARM64)

Requirements

  • Root Access: Script must run as root
  • Fresh VPS: Recommended for first-time installation
  • Open Ports: Ability to open custom ports (default: random 2000-65535)
  • Domain Name: Required for SSL certificate (with DNS A record pointing to VPS)

Minimum Specifications

  • RAM: 512 MB minimum, 1 GB recommended
  • Storage: 2 GB free space
  • Network: Public IP address (IPv4 or IPv6)

🚀 Quick Start

Installation

# Download the script
wget -N https://raw.githubusercontent.com/hendrywang/Naiveproxy_Neo/main/naiveproxy_neo.sh

# Make it executable
chmod +x naiveproxy_neo.sh

# Run the script
./naiveproxy_neo.sh

First-Time Setup

  1. Select Option 1 (Install Naiveproxy)
  2. Choose installation method (online compilation recommended)
  3. Configure SSL certificate (ACME script or custom)
  4. Set proxy port (or use random)
  5. Set username (minimum 3 characters)
  6. Set password (minimum 5 characters)
  7. Set masquerade website (default: example.com)
  8. Set Caddy listening port (or use random)

The script will automatically:

  • Install all dependencies
  • Configure firewall rules
  • Generate SSL certificates
  • Start the proxy service
  • Display share links and QR codes

📖 Detailed Installation Guide

Step 1: Prepare Your VPS

  1. Purchase a VPS from providers like:

    • DigitalOcean, Vultr, Linode
    • AWS Lightsail, Google Cloud
    • Any provider supporting Ubuntu/Debian/CentOS
  2. Set up a domain name:

    • Purchase a domain from Namecheap, Cloudflare, etc.
    • Create an A record pointing to your VPS IP
    • Wait for DNS propagation (5-30 minutes)
  3. Connect via SSH:

    ssh root@your-vps-ip

Step 2: Download and Run Script

# Update system packages (optional but recommended)
apt update && apt upgrade -y  # Ubuntu/Debian
yum update -y                 # CentOS

# Download the script
wget -N https://raw.githubusercontent.com/hendrywang/Naiveproxy_Neo/main/naiveproxy_neo.sh

# Make executable
chmod +x naiveproxy_neo.sh

# Run the script
./naiveproxy_neo.sh

Step 3: Installation Process

3.1 Choose Naiveproxy Core Installation Method

1. Please select installation or update method for naiveproxy core:
1. Online compilation of caddy2-naiveproxy version (slower, may fail, default)
2. Build from source (requires Go environment)
Please select:

Recommendation: Select 1 (online compilation) for most users.

3.2 Configure SSL Certificate

2. Naiveproxy certificate configuration:
1. Use ACME script for certificate (supports port 80 mode and DNS API mode) (default)
2. Custom certificate path
Please select:

Option 1 (Recommended): Automatic certificate via ACME

  • The script will guide you through domain verification
  • Supports both HTTP-01 (port 80) and DNS-01 (DNS API) challenges
  • Automatic renewal configured

Option 2: Use existing certificates

  • Provide paths to your .crt and .key files

3.3 Set Proxy Port

3. Set Naiveproxy port [1-65535] (press Enter for random port 2000-65535):
  • Default: Random port between 2000-65535
  • Custom: Enter specific port (ensure it's not occupied)
  • Note: This is the port clients will connect to

3.4 Set Username

4. Set username (minimum 3 characters, press Enter for random):
  • Default: Random 3-character string
  • Custom: Any username ≥3 characters
  • Security: Use strong, unique username

3.5 Set Password

5. Set password (minimum 5 characters, press Enter for random):
  • Default: Random 5-character string
  • Custom: Any password ≥5 characters
  • Security: Use strong password with mixed characters

3.6 Set Masquerade Website

6. Set masquerade website (do not include http(s)://, press Enter for default: example.com):
  • Purpose: Website to display when accessing proxy URL directly
  • Default: example.com
  • Recommendation: Use a popular, legitimate website (e.g., www.google.com)
  • Note: Do not include http:// or https://

3.7 Set Caddy Listening Port

7. Set caddy2-naiveproxy listening port [1-65535] (press Enter for random port 2000-65535):
  • Purpose: HTTP port for Caddy's internal operations
  • Default: Random port between 2000-65535
  • Note: Different from proxy port; not directly used by clients

Step 4: Installation Complete

Upon successful installation, the script displays:

Naiveproxy proxy service installation completed. Shortcut command: na

v2rayn client configuration file v2rayn.json saved to /root/naive/v2rayn.json
{
  "listen": "socks://127.0.0.1:1080",
  "proxy": "https://username:[email protected]:port"
}

Share link saved to /root/naive/URL.txt
naive+https://username:[email protected]:port?padding=true#Naive-hostname

QR code share link (Nekobox)
[QR CODE DISPLAYED]

Save this information! You'll need it to configure client applications.


⚙️ Configuration Options

Quick Access Command

After installation, access the script anytime with:

na

Configuration Files

File Purpose Location
Caddyfile Main Caddy configuration /etc/caddy/Caddyfile
v2rayn.json V2rayN config file /root/naive/v2rayn.json
URL.txt Share link /root/naive/URL.txt
cert.crt SSL certificate /root/naivecert/cert.crt
private.key SSL private key /root/naivecert/private.key

Service Management

# Check service status
systemctl status caddy

# Start service
systemctl start caddy

# Stop service
systemctl stop caddy

# Restart service
systemctl restart caddy

# Enable auto-start on boot
systemctl enable caddy

# View logs
journalctl -u caddy -f

🎮 Menu Functions

Access the main menu by running:

./naiveproxy_neo.sh
# or simply
na

Main Menu Options

 1. Install Naiveproxy
 2. Uninstall Naiveproxy
 3. Change Configuration (multi-port, credentials, certificate, masquerade)
 4. Stop / Restart Naiveproxy
 5. Update Naiveproxy-NEO Script
 6. Update Naiveproxy Core Version
 7. Show Naiveproxy Share Link, V2rayN Config, QR Code
 8. View Naiveproxy Service Logs
 9. Manage Acme Certificate Application
10. Manage Warp (Check Netflix, ChatGPT unlock status)
11. Install BBR+FQ Acceleration
 0. Exit Script

Option Details

1. Install Naiveproxy

  • Complete installation wizard
  • Handles all dependencies automatically
  • Configures firewall and services
  • Generates credentials and certificates

2. Uninstall Naiveproxy

  • Completely removes Naiveproxy
  • Deletes all configuration files
  • Removes service files
  • Cleans up dependencies

3. Change Configuration

Submenu with options:

  1. Add/Remove Multi-Port: Set up proxy on multiple ports
  2. Change Main Port: Modify primary proxy port
  3. Change Username: Update authentication username
  4. Change Password: Update authentication password
  5. Re-apply Certificate: Renew or change SSL certificate
  6. Change Masquerade Website: Update disguise website

4. Stop / Restart Naiveproxy

  • Restart: Reload service with new configs
  • Stop: Completely stop the service

5. Update Naiveproxy-NEO Script

  • Updates the management script itself
  • Preserves configurations

6. Update Naiveproxy Core Version

  • Updates Caddy/Naiveproxy binaries
  • Uses latest version from upstream

7. Show Share Link

  • Displays V2rayN configuration
  • Shows share URL
  • Generates QR code for Nekobox

8. View Service Logs

  • Real-time log monitoring
  • Press Ctrl+C to exit
  • Useful for troubleshooting

9. Manage ACME Certificate

  • Apply for new SSL certificates
  • Renew existing certificates
  • Supports multiple domains

10. Manage Warp

  • Configure Cloudflare Warp
  • Check streaming service availability
  • Useful for Netflix, ChatGPT access

11. Install BBR Acceleration

  • Installs BBR congestion control
  • Improves connection speed
  • Optimizes network performance

📱 Client Configuration

V2rayN (Windows)

  1. Download V2rayN: GitHub Releases

  2. Import Configuration:

    • Method 1: Import JSON file (/root/naive/v2rayn.json)
    • Method 2: Import from share URL
    • Method 3: Scan QR code
  3. Manual Configuration:

    Server: yourdomain.com
    Port: your-port
    Username: your-username
    Password: your-password
    Protocol: Naive
    

Nekobox (Android/iOS)

  1. Download Nekobox:

    • Android: Google Play or GitHub
    • iOS: App Store
  2. Scan QR Code:

    • Run na on server
    • Select option 7
    • Scan displayed QR code with Nekobox
  3. Manual Setup:

    • Paste share URL from /root/naive/URL.txt
    • Format: naive+https://user:pass@domain:port?padding=true#Name

Command Line Testing

Test connection directly:

curl -v --proxy https://username:[email protected]:port https://www.google.com

🔧 Advanced Usage

Multi-Port Multiplexing

Run proxy on multiple ports:

  1. Run na → Select option 3 → Select option 1
  2. Choose "Add multi-port multiplexing"
  3. Enter new port number
  4. Repeat to add more ports

Use Case:

  • Load balancing
  • Port redundancy if one port is blocked
  • Different users on different ports

Custom Certificate Paths

If you prefer managing certificates externally:

  1. During installation, select option 2 for certificates
  2. Provide paths to your certificate files:
    • Certificate: /path/to/cert.crt
    • Private Key: /path/to/private.key

IPv6-Only VPS Support

The script automatically detects IPv6-only environments and:

  • Configures DNS64 resolvers
  • Ensures proper connectivity
  • No manual intervention required

OpenVZ Virtualization

For OpenVZ VPS:

  • Script automatically enables TUN/TAP
  • Sets up persistent TUN device
  • Configures auto-start on reboot

🐛 Troubleshooting

Installation Issues

Problem: Dependencies fail to install

# Manually update package manager
apt update && apt upgrade -y  # Ubuntu/Debian
yum update -y                 # CentOS

# Then re-run script
./naiveproxy_neo.sh

Problem: Certificate application fails

  • Ensure domain DNS is properly configured
  • Check if port 80 is accessible (for HTTP-01 challenge)
  • Verify firewall allows incoming connections
  • Try DNS-01 challenge mode instead

Service Issues

Problem: Service fails to start

# Check service status
systemctl status caddy

# View detailed logs
journalctl -u caddy -n 50 --no-pager

# Common fixes:
# 1. Check if port is already in use
ss -tunlp | grep :your-port

# 2. Verify Caddyfile syntax
/usr/bin/caddy validate --config /etc/caddy/Caddyfile

# 3. Check certificate paths
ls -la /root/naivecert/

Problem: Connection refused from client

  1. Verify service is running:

    systemctl status caddy
  2. Check firewall:

    # Ubuntu/Debian
    ufw status
    
    # CentOS
    firewall-cmd --list-all
  3. Test locally:

    curl -v https://yourdomain.com:your-port

Performance Issues

Problem: Slow connection speeds

  1. Install BBR:

    • Run na → Select option 11
    • Reboots VPS to apply kernel changes
  2. Check VPS resources:

    # CPU usage
    top
    
    # Memory usage
    free -h
    
    # Network usage
    iftop
  3. Optimize Caddy:

    # Increase buffer size
    sysctl -w net.core.rmem_max=8000000

❓ FAQ

General Questions

Q: Is Naiveproxy free?

A: Yes, Naiveproxy is completely free and open-source.

Q: Do I need coding knowledge?

A: No, this script is designed for users of all levels. Just follow the prompts.

Q: Can I use this for commercial purposes?

A: Yes, under MIT license terms.

Technical Questions

Q: What's the difference between Naiveproxy and other proxies?

A: Naiveproxy uses Chrome's network stack, making traffic indistinguishable from regular browser activity. This provides superior resistance to detection compared to traditional proxy protocols.

Q: Can I run multiple instances?

A: Yes, using multi-port multiplexing (option 3.1 in menu).

Q: How do I backup my configuration?

# Backup important files
cp /etc/caddy/Caddyfile /root/backup/
cp -r /root/naivecert /root/backup/
cp /root/naive/URL.txt /root/backup/

Q: How often should I update?

A: Check for updates monthly. Major security updates should be applied immediately.

Troubleshooting Questions

Q: Certificate renewal failed, what should I do?

# Re-run ACME script
na
# Select option 9
# Follow prompts to renew

Q: Service won't start after reboot

# Enable auto-start
systemctl enable caddy

# Check if TUN device exists (for OpenVZ)
cat /dev/net/tun

🤝 Contributing

Contributions are welcome! Please follow these guidelines:

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution Areas

  • 🐛 Bug fixes
  • ✨ New features
  • 📝 Documentation improvements
  • 🌍 Translations
  • 🧪 Testing on different platforms

Code Style

  • Use 4 spaces for indentation
  • Follow existing bash scripting conventions
  • Add comments for complex logic
  • Test on Ubuntu, Debian, and CentOS

📄 License

This project is licensed under the MIT License - see below for details:

MIT License

Copyright (c) 2024 Naiveproxy NEO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

🙏 Acknowledgments

This project builds upon the excellent work of:

Third-Party Tools

The script integrates with:

  • ACME Script - SSL certificate automation
  • CFwarp - Cloudflare Warp integration
  • BBR Script - TCP congestion control optimization

📞 Support

Getting Help

Support This Project

If you find this project helpful, please consider supporting its development:

Buy Me A Coffee

Your support helps:

  • 🛠️ Maintain and improve the script
  • 📝 Create better documentation
  • 🐛 Fix bugs and add new features
  • ⚡ Keep the project actively maintained

Every contribution, no matter how small, is greatly appreciated! 💙


⭐ Star History

If you find this project useful, please consider giving it a star! ⭐


Disclaimer: This tool is provided for educational and privacy protection purposes. Users are responsible for complying with local laws and regulations.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages