vite-plugin-switch-hosts
v0.0.8
Published
switch hosts by service worker for each origin in browser without modify system hosts file
Downloads
2
Maintainers
Readme
vite-plugin-switch-hosts
switch hosts by service worker for each origin in browser without modify system hosts file
feature
- switch hosts
- different origin can use different hosts simultaneously
- without modify system hosts file
limitation
current origin must support service worker. in other words,
location.hostname
islocalhost
or match127.x.y.z
, orlocation.protocol
must behttps:
target domain must use http or https, websocket is not supported
redirect url will follow in proxy dev server, not found a better solution yet
install
pnpm add -D vite-plugin-switch-hosts
config
export interface SwitchHostsOption {
/**
* host -> another_host
*/
dns?: Record<string, string>;
}