2024-10-11 00:09:16 +08:00
2024-10-07 02:10:56 +08:00
2024-10-11 00:09:16 +08:00
2024-10-10 19:15:49 +08:00

MCG - MCG is for Configuration Generation

Overview

MCG is a JavaScript-based tool that simplifies and optimizes the configuration of the Multi-function network tool—a cross-platform, rule-based utility for managing network and application traffic. It provides extensive support for advanced features and custom configurations.

Key Features

  • Customizable Icon Sets: Import icon sets from a CDN to visually represent services and locations.
  • Flexible Service Configuration: Easily add, remove, or modify services, including custom names and icons.
  • Location Filters: Use country-specific filters and custom icons for detailed location configuration.
  • Advanced DNS Management:
    • Supports Chinese and international nameservers.
    • Configurable DNS settings including fake IP, filtering, and custom policies.
  • Proxy Group Management:
    • Various proxy group types (e.g., Auto, Fallback, Load Balancing).
    • Automatic grouping for services and locations.
  • Intelligent Routing Rules:
    • Rule-based routing for diverse services and applications.
    • Integration with popular rule providers.
  • Seamless Rule Provider Integration: Set up and maintain rule providers automatically with regular updates.
  • Extensible Architecture: Add new services, locations, or modify existing configurations easily.
  • Performance Optimization: Includes lazy loading, configurable health checks, and optimized rule updates.
  • Customizable TUN Mode: Configure TUN mode for improved compatibility and performance.
  • Privacy and Ad-Blocking: Integrated rules for blocking ads and trackers.
  • Automatic Updates: Enable auto-updates for GeoIP and GeoSite data.
  • Compatibility: Supports the Multi-functional network tool clients, enhancing standard configurations.

URLs for Importing MCG Script

Choose one of the following URLs to import the MCG script:

Source URL
GitHub Raw https://raw.githubusercontent.com/xixu-me/MCG/refs/heads/main/script.js
jsDelivr https://cdn.jsdelivr.net/gh/xixu-me/MCG@main/script.js
jsDelivr on Cloudflare https://testingcf.jsdelivr.net/gh/xixu-me/MCG@main/script.js
GitHub Proxy https://ghp.ci/https://raw.githubusercontent.com/xixu-me/MCG/refs/heads/main/script.js

Usage Guide

Follow these steps to use MCG:

1. Prepare Base Configuration

Start with a valid Multi-function network tool configuration file containing at least one proxy or proxy provider, typically generated by importing a subscription URL into your client.

2. Import MCG Script

  • For M.P.:

    1. Go to "Override" in the sidebar and import the MCG script.
    2. Edit and save the override if needed.
    3. In "Subscription Management," select the subscription to modify, and set the MCG script as the override.
  • For Other Clients (e.g., C.V.R.):

    1. Navigate to the configuration page.
    2. Add the MCG script content into the configuration editor.
    3. Save and enable the script.

3. Apply and Update Configuration

  • For M.P., changes apply automatically after importing the script.
  • For other clients, manually update or reload the configuration if necessary.

4. Verify the Configuration

Check your client’s execution log to ensure the MCG script is applied successfully.

Note: The MCG script will override specific parts of your configuration (e.g., DNS settings, proxy groups).

Customization Guide

MCG is highly customizable. Below are some key areas you can modify:

1. Icon Set URL

Change the ICON_SET_URL constant to use a different icon set.

2. Services

Modify the services array to add or remove services:

{
    name: "NewService",
    alias: "New Service",
    icon: `${ICON_SET_URL}new_service_icon.png`,
}

3. Locations

Customize the locations array to define geographical locations:

  • name: Location name.
  • filter: Regex pattern for matching.
  • icon: URL of the location icon.

4. General Configuration

Adjust generalConfig settings like:

  • allow-lan: Set to true for LAN access.
  • log-level: Set logging level (info, debug).
  • ipv6: Enable/disable IPv6 support.

5. DNS Settings

Modify the dns object to change nameservers and DNS policies.

6. Proxy Groups

Create or modify proxy groups in the proxyGroups array.

7. Routing Rules

Customize the rules array for traffic management.

8. Rule Providers

Add or modify custom rule providers in the ruleProviders object.

For detailed documentation, refer to the official Multi-function network tool documentation.

Requirements

  • A valid configuration file with at least one proxy or proxy provider defined.
  • A compatible client that supports JavaScript overrides.

Demo

A demo that use MCG to generate a configuration for the Multi-function network tool is available at MCG Demo.

Disclaimer

  1. This repository is strictly for educational and research purposes.
  2. Use at your own risk. The repository assumes no responsibility for potential issues.
  3. No guarantee of accuracy, completeness, or reliability.
  4. Not liable for data loss or damages.
  5. Ensure compliance with relevant licenses and legal regulations.
  6. No endorsement of third-party hardware/software.
  7. User modifications are their own responsibility.
  8. Terms may change at any time. By using this content, you agree to these terms.

License

Copyright © 2024 Xi Xu. All rights reserved.

Licensed under the GPL-3.0 license.

S
Description
The inputs stay modular, the generated output adds stronger routing structure on top, and the overall repository is organized as an architecture with clear roles for source, validation, and published artifacts
Readme
316 KiB
0 Stars 1 Watchers 0 Forks