Skip to content

Usage of the @ Symbol

When you want to store rules on a remote server or in a local project file and have Whistle automatically synchronize and update them, you can use the @ symbol in the rules.

Syntax Rules

1. Importing Rule Files (@path)

Dynamically load the content of external rule files. Whistle will periodically update the content from the rule files.

Usage Format: @file-path-or-url

Supported Types:

  • Remote URL: @https://example.com/rules.txt
  • Local File: @~/projects/rules.txt (supports all operating system paths)
  • Plugin Interface: @whistle.nohost/api/rules (requires the plugin to implement the interface)

Windows Path Compatibility: Supports mixing / and \ as path separators:

txt
@C:/whistle/rules.txt  
@D:\config\proxy.rules

Configuration Examples

Import Remote Rule Files

txt
@https://raw.githubusercontent.com/your-org/configs/master/whistle-rules.txt

Import Local Project Rules

txt
@/Users/username/projects/my-app/whistle-config.txt  
@~/dev/configs/rules.txt  # Using the user directory

Import Rules Provided by Plugins

txt
@whistle.nohost/api/rules

Mixed Usage Example

txt
# Import team-shared base rules  
@https://team.example.com/configs/base-rules.txt  

# Import personal project-specific rules  
@~/projects/my-app/whistle-overrides.txt

File Format Requirements

Imported external files should contain standard Whistle rule syntax:

txt
# Example of a remote rule file  
www.example.com proxy://127.0.0.1:8080  
api.example.com resCors://*  
static.example.com cache://3600