Skip to content

Add GeoIP-based address selection for multi-address Hosts #523

@mustfqyl

Description

@mustfqyl

Title:
Add GeoIP-based address selection for multi-address Hosts

Body:
Currently, when a Host has multiple addresses, PasarGuard randomly selects one address during subscription generation.

This is useful for simple random distribution, but not ideal for multi-region VPN/proxy deployments.

Example:

  • dk-cph.example.com
  • de-fra.example.com
  • us-nyc.example.com

A user in Denmark may randomly receive the Germany or US node instead of the Denmark node, which causes higher latency.

Please consider adding an address selection mode for Hosts, such as:

  • Random
  • GeoIP / nearest node
  • Sticky selection
  • Priority / fallback

For GeoIP mode, PasarGuard could use the subscriber request IP to choose the closest address.

Example:

  • DK user → dk-cph.example.com
  • DE user → de-fra.example.com
  • Unknown location → default/fallback address

This would allow providers to show only one clean node in the client while automatically giving users the nearest backend server.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions