VirtualDDNSRouter Server
The VirtualDDNSRouter Server is a lightweight reverse proxy that maintains dynamic mappings between paths and IP addresses. Clients can update their IP addresses, and users can access services through consistent URLs.
Configuration
The server uses a YAML rules file named rules.yaml
. You can create this file by copying and modifying the provided
example:
cp rules.example.yaml rules.yaml
The rules file has the following structure:
- name: Odoo Server # A descriptive name for the service
api_key: abc123XYZ # The API key for authentication
path: odoo # The path identifier for the service
- name: Backup server
api_key: def456ABC
path: bk
Each entry defines a service with:
name
: A descriptive label (for documentation purposes)api_key
: A secret key used by clients to authenticate updatespath
: The URL path that users will use to access the service
Running the Server
Method 1: Downloading Pre-built Binaries (Recommended)
- Download the latest server binary from https://git.mahdium.ir/mahdium/VDR/releases/latest
- Extract the archive
- Create your
rules.yaml
file based onrules.example.yaml
- Run the server:
./VirtualDDNSRouter.Server
By default, the server listens on port 8080. You can change this by setting the ASPNETCORE_HTTP_PORTS
environment
variable:
ASPNETCORE_HTTP_PORTS=8081 ./VirtualDDNSRouter.Server
Method 2: Using Docker
docker run -p 8080:8080 -v ./rules.yaml:/app/rules.yaml virtualddnsrouter.server
Method 3: Building from Source
dotnet build
dotnet run
Usage
The server provides two main endpoints:
-
IP Update Endpoint (used by clients):
GET /setip/{path}/{port}/{api_key}
Clients call this endpoint to update their IP address.
-
Service Access Endpoint (used by users):
GET /goto/{path}
Users access this endpoint to reach the service associated with the path.
For example, if a client has configured a service with path "odoo", users can access it at:
http://your-server:8080/goto/odoo
The server will redirect users to the IP address and port that the client last reported.