{"id":26363275,"url":"https://github.com/slimani-dev/dynamichost","last_synced_at":"2025-07-22T10:34:20.988Z","repository":{"id":281373988,"uuid":"945059825","full_name":"slimani-dev/dynamichost","owner":"slimani-dev","description":"DynamicHost - A Custom Traefik Middleware Plugin","archived":false,"fork":false,"pushed_at":"2025-03-08T16:48:29.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T17:20:55.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slimani-dev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T15:09:23.000Z","updated_at":"2025-03-08T16:48:32.000Z","dependencies_parsed_at":"2025-03-08T17:31:53.423Z","dependency_job_id":null,"html_url":"https://github.com/slimani-dev/dynamichost","commit_stats":null,"previous_names":["slimani-dev/dynamic-host"],"tags_count":1,"template":false,"template_full_name":"traefik/plugindemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimani-dev%2Fdynamichost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimani-dev%2Fdynamichost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimani-dev%2Fdynamichost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimani-dev%2Fdynamichost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slimani-dev","download_url":"https://codeload.github.com/slimani-dev/dynamichost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910739,"owners_count":20367546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-16T18:27:24.436Z","updated_at":"2025-03-16T18:27:25.610Z","avatar_url":"https://github.com/slimani-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DynamicHost Plugin for Traefik\n\n[![Build Status](https://github.com/yourusername/dynamichost-plugin/workflows/Main/badge.svg?branch=master)](https://github.com/yourusername/dynamichost-plugin/actions)\n\nThe `DynamicHost` plugin is a middleware for [Traefik](https://traefik.io) that dynamically rewrites the host header based on a regex pattern. This allows flexible host transformation based on request attributes.\n\n## Features\n- Uses a regex pattern to match and transform the host dynamically.\n- Allows custom host structures for different incoming requests.\n- Fully compatible with Traefik's middleware system.\n\n## Configuration\n\nTo use the `DynamicHost` plugin, you must define it in the **static configuration** of Traefik:\n\n```yaml\n# Static configuration\nexperimental:\n  plugins:\n    dynamichost:\n      moduleName: github.com/slimani-dev/dynamichost\n      version: v0.1.0\n```\n\nThen, you can configure it dynamically:\n\n```yaml\n# Dynamic configuration\nhttp:\n  routers:\n    my-router:\n      rule: Host(`example.localhost`)\n      service: my-service\n      entryPoints:\n        - web\n      middlewares:\n        - dynamic-host\n\n  services:\n    my-service:\n      loadBalancer:\n        servers:\n          - url: http://127.0.0.1:8080\n\n  middlewares:\n    dynamic-host:\n      plugin:\n        dynamichost:\n          regexPattern: \"^([^.]+)\\\\.localhost$\"\n          newHost: \"$1.example.com\"\n```\n\n### Parameters\n\n| Parameter       | Type   | Description |\n|----------------|--------|-------------|\n| `regexPattern` | string | The regex pattern used to match the original host. |\n| `newHost`      | string | The new host format using regex capture groups. |\n\n### Example Behavior\n\n| Incoming Host      | Transformed Host  |\n|-------------------|------------------|\n| `abc.localhost`   | `abc.example.com` |\n| `test.localhost`  | `test.example.com` |\n\n## License\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimani-dev%2Fdynamichost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslimani-dev%2Fdynamichost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimani-dev%2Fdynamichost/lists"}