{"id":19377751,"url":"https://github.com/eliottvincent/vite-plugin-allowed-hosts","last_synced_at":"2026-05-07T16:40:56.772Z","repository":{"id":153270025,"uuid":"627350384","full_name":"eliottvincent/vite-plugin-allowed-hosts","owner":"eliottvincent","description":"🚦 Specify a list of hosts that are allowed to access your Vite dev server.","archived":false,"fork":false,"pushed_at":"2025-06-17T11:52:32.000Z","size":167,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T12:09:15.159Z","etag":null,"topics":["allowed","header","host","server","vite"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vite-plugin-allowed-hosts","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliottvincent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-04-13T09:32:13.000Z","updated_at":"2025-09-17T06:18:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd60efb3-3bcb-4229-9bed-4f3bfdc7983d","html_url":"https://github.com/eliottvincent/vite-plugin-allowed-hosts","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"5abd342b8434f077e852b535172777b875c3ebe8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/eliottvincent/vite-plugin-allowed-hosts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliottvincent%2Fvite-plugin-allowed-hosts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliottvincent%2Fvite-plugin-allowed-hosts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliottvincent%2Fvite-plugin-allowed-hosts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliottvincent%2Fvite-plugin-allowed-hosts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliottvincent","download_url":"https://codeload.github.com/eliottvincent/vite-plugin-allowed-hosts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliottvincent%2Fvite-plugin-allowed-hosts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32746497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["allowed","header","host","server","vite"],"created_at":"2024-11-10T09:03:17.977Z","updated_at":"2026-05-07T16:40:56.768Z","avatar_url":"https://github.com/eliottvincent.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite Allowed Hosts\n\n[![Build Status](https://github.com/eliottvincent/vite-plugin-allowed-hosts/actions/workflows/test.yml/badge.svg)](https://github.com/eliottvincent/vite-plugin-allowed-hosts/actions) [![Version](https://img.shields.io/npm/v/vite-plugin-allowed-hosts.svg)](https://www.npmjs.com/package/vite-plugin-allowed-hosts) [![Downloads](https://img.shields.io/npm/dt/vite-plugin-allowed-hosts.svg)](https://www.npmjs.com/package/vite-plugin-allowed-hosts)\n\n\u003e Specify a list of hosts that are allowed to access your Vite dev server.\n\n# ⚠️ DEPRECATED\n\nThis plugin is now deprecated as Vite provides a native option for this functionality since version 5.4.12.\n\nPlease use Vite's built-in [`server.allowedHosts`](htthttps://vite.dev/config/server-options.html#server-allowedhosts) option instead.\n\n\n## Motivation\n\nBy rejecting requests with an unrecognized `Host` header, this plugin prevents **DNS rebinding attacks**, which are possible even under many seemingly-safe web server configurations.\n\nIn a [DNS rebinding attack](https://en.wikipedia.org/wiki/DNS_rebinding), an attacker can create a malicious website that makes requests to the development server using the victim’s browser, potentially gaining access to sensitive data or executing unauthorized actions.\n\n\n## Usage\n\n```js\n// vite.config.js\nimport allowedHostsPlugin from \"vite-plugin-allowed-hosts\";\n\nexport default {\n  plugins: [\n    allowedHostsPlugin({\n      hosts: [\"acme.com\", \".dev.acme.com\"]\n    })\n  ]\n}\n```\n\n\n## Options\n\n#### `hosts`\n\n- **Type:** `'auto' | 'all' | string | string[]`\n- **Default:** `'auto'`\n\n  When set to `'auto'`, it will always allow `localhost` and [`server.host`](https://vitejs.dev/config/server-options.html#server-host).\n\n  When set to `'all'`, no header check will be done. This is obviously **not recommended**.\n\n  A value beginning with a period `.` can be used as a subdomain wildcard. For example, `'.acme.com'` will match `acme.com`, `www.acme.com`, and any other subdomain of `acme.com`.\n\n  If the `Host` header doesn't match any value in this list, a **403** Forbidden HTTP error will be returned.\n\n## License\n\nvite-plugin-allowed-hosts is released under the MIT License. See the bundled LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliottvincent%2Fvite-plugin-allowed-hosts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliottvincent%2Fvite-plugin-allowed-hosts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliottvincent%2Fvite-plugin-allowed-hosts/lists"}