Skip to content

Implement Reverse Proxy Functionality #4828

@mehdikhody

Description

@mehdikhody

​Hello,
First and foremost, I would like to extend my heartfelt gratitude to all the contributors of the Hiddify-Manager project. Your dedication and hard work have been instrumental in developing this robust tool, and your efforts are deeply appreciated.

I would like to suggest the addition of a reverse proxy feature in Hiddify-Manager, similar to the functionality provided by 3x-ui. This feature would involve installing panels on both the bridge (relay) and upstream (main) servers.

Proposed Configuration:
Bridge Server (config.json):

{
  "inbounds": [
    ...,
    {
      "port": 2083,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "65e9cc15-0916-4ebd-bc20-9ed7d06cdac9"
          }
        ]
      },
      "streamSettings": {
        // Additional stream settings
      }
    }
  ],
  "rules": [
    ...,
    {
      "outboundTag": "reverse-relay",
      "inboundTag": ["inbound-2083"],
      "domain": ["full:relay.xui"],
      "type": "field"
    },
    {
      "outboundTag": "reverse-relay",
      "inboundTag": ["inbound-80", "inbound-443"],
      "type": "field"
    }
  ],
  "reverse": {
    "portals": [
      {
        "tag": "reverse-relay",
        "domain": "relay.xui"
      }
    ]
  }
}

Upstream Server (config.json):

{
  ...,
  "outbounds": [
    ...,
    {
      "tag": "relay",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "relay.server.com",
            "port": 2083,
            "users": [
              {
                "id": "65e9cc15-0916-4ebd-bc20-9ed7d06cdac9"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        // Additional stream settings
      }
    }
  ],
  "routing": [
    ...,
    {
      "domain": ["full:relay.xui"],
      "outboundTag": "relay",
      "inboundTag": ["reverse-relay"],
      "type": "field"
    },
    {
      "outboundTag": "direct",
      "inboundTag": ["reverse-relay"],
      "type": "field"
    }
  ],
  "reverse": {
    "bridges": [
      {
        "tag": "reverse-relay",
        "domain": "relay.xui"
      }
    ]
  }
}

In this setup, the upstream server connects to the bridge server, establishing a communication channel between the two. The bridge server is configured to forward inbound traffic on ports 80 and 443 to the upstream server, effectively acting as a reverse proxy.​

Thank you for considering this enhancement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions