Switch your host/IP mappings in real time without editing your hosts file

Latest Version

Version
2.0.0
Update
March 29, 2022
Size
57.78KiB
Developer
Category
Users
10,000+
Rating
3.325 ★
Manifest Version
3
Web Store Status
Languages Support
English
See more
Permissions
DeclarativeNetRequestWithHostAccess
Scripting
Storage
See more

LiveHosts Extension

LiveHosts is a Chrome extension that aims at providing a working (even if sub-obtimal) solution to a common nuisance that many web developers have to deal with every day. If you have multiple versions of your websites sharing the same host names on multiple environments, you often need to switch the assignments in your OS hosts file.

Other extensions (like the life-saving HostAdmin) can help with the cumbersomeness, but changes to the hosts file usually take an inconvenient amount of time to actually affect the browser.

Unfortunately, there is no way to make Chrome direct requests for a hostname to a specific IP without a standard redirect - you could set up a smart HTTP proxy, but it's often not possible or not convenient.

This extension settles for a sub-obtimal approach: requests to the indicated hostnames are redirected to the chosen IPs with an additional Host header. The browser's address bar reflects this behaviour showing the hostname right after the IP (e.g. http://127.0.0.1/www.example.com/). The extension also tries to take care of all requests to either the IP or the hostname in a consistent way.

Issues

After the redirect, the user is effectively in a different domain that the one they expected. They may notice some functional differences:

- depending on the server, parts of a web page referring to the site URL (like href and src attributes) could be different from the original
- window.location has a different value that can potentially throw off JavaScript snippets
- most Cross-Origin request won't work
Read more

Source Manifest.json

{"update_url": "https://clients2.google.com/service/update2/crx", "manifest_version": 3, "name": "LiveHosts", "version": "2.0.0", "icons": { "16": "icons/livehosts-16.png", "48": "icons/livehosts-48.png", "128": "icons/livehosts-128.png" }, "description": "Switch your host/IP mappings in real time without editing your hosts file", "background": { "service_worker": "background.js", "type": "module" }, "options_page": "options.html", "action": { "default_icon": { "19": "icons/livehosts-19.png", "38": "icons/livehosts-38.png" }, "default_popup": "popup/popup.html" }, "web_accessible_resources": [ { "resources": [ "/popup/*" ], "matches": [ "*://*/*" ] } ], "incognito": "split", "permissions": [ "declarativeNetRequestWithHostAccess", "scripting", "storage" ], "host_permissions": [ "*://*/*" ]}
Read more

Similar Extensions

icon

Virtual Hosts Extension · Developer Tools 10,000+ 102 ★ 9.7KiB

icon

Awesome Host Manager Extension · Developer Tools 10,000+ 15 ★ 969KiB

icon

Domain Switcher Extension · Developer Tools 10,000+ 29 ★ 1.05MiB

icon

Virtual Hosts Extension · Developer Tools 10,000+ 16 ★ 274KiB

icon

URL's Host Switcher Extension · Developer Tools 10,000+ 1 ★ 75.14KiB

icon

Website IP Extension · Developer Tools 10,000+ 207 ★ 55.45KiB

icon

HostSwitcher Extension · Developer Tools 10,000+ 2 ★ 7.57KiB

icon

HostAdmin Extension · Developer Tools 10,000+ 53 ★ 181KiB

icon

Requestly - Intercept, Modify & Mock HTTP Requests Extension · Developer Tools 10,000+ 1227 ★ 876KiB

icon

Switch environment Extension · Developer Tools 10,000+ 4 ★ 43.0KiB

icon

Domain Changer Extension · Developer Tools 10,000+ 6 ★ 252KiB

icon

Hosts modifier Extension · Developer Tools 10,000+ 6 ★ 274KiB

icon

ModHeader - Modify HTTP headers Extension · Developer Tools 10,000+ 1061 ★ 676KiB

icon

Xdebug helper Extension · Developer Tools 10,000+ 429 ★ 70.13KiB

icon

Host name rewriter Extension · Productivity 10,000+ 14 ★ 28.02KiB

icon

Siderite's DNS Resolver Extension · Productivity 10,000+ 5 ★ 58.61KiB

icon

DNS Flusher Extension · Developer Tools 10,000+ 16 ★ 18.67KiB

icon

Flush DNS & close sockets Extension · Developer Tools 10,000+ 4 ★ 20.54KiB

icon

Server IP Extension · Developer Tools 10,000+ 48 ★ 35.34KiB

icon

Modify Header Value (HTTP Headers) Extension · Developer Tools 10,000+ 46 ★ 94.33KiB

icon

Web Vitals Extension · Developer Tools 10,000+ 43 ★ 398KiB

icon

CSS Used Extension · Developer Tools 10,000+ 184 ★ 164KiB

icon

User CSS Extension · Developer Tools 10,000+ 264 ★ 298KiB

icon

Dr.FLARE Extension · Developer Tools 10,000+ 13 ★ 1.66MiB

User reviews

icon

Serge (ID: 000000ae07edaa9f) Voted 5 ★ - Updated 10/10/2023 Действительно работает =) Перепробовал все их, это единственное, которое на сегодняшний день работает. Да ещё и по вкладкам работает. Одни вкладки на оригинал сайта, другие на тот же сайт на виртуальной машине – всё прекрасно работает.

icon

Ree Wankko (ID: 00000072de37b23e) Voted 2 ★ - Updated 09/06/2023 不是我希望的能替代 /etc/hosts 的插件,他只是修改了请求的host,这实际上会造成各种异常情况,就想别的评论中说的一样。

icon

Josue Garcia (ID: 0000004cbded0b8f) Voted 2 ★ - Updated 08/30/2023 The extension is not working on Chrome, but runs very well on Firefox, is there something to make it work on google chrome?

icon

Null Null (ID: 00000079d9e703c6) Voted 1 ★ - Updated 08/25/2023 It's already been said in comments here, but this does not do what it says. It rewrites the URL and replaces the domain with the IP you specify. This is absolutely no good for servers doing SNI!

icon

Renato Frota (ID: 0000003f1388da1d) Voted 5 ★ - Updated 07/15/2023 PT-BR. Vou dar 5 estrelas pela criatividade, mas no mundo atual, em que HTTPS já se tornou o protocolo padrão de fato e as diversas proteções CORS (Cross Origin Resource Sharing) também já estão bastante comuns, a extensão não tem mais valia. Recomendo o serviço SkipDNS, que não depende de extensão e funciona até mesmo em dispositivos móveis, sem necessidade de configuração prévia por parte das outras pessoas com quem você quiser compartilhar o link de pré-visualização. English. I'll give it 5 stars for creativity, but in today's world, where HTTPS has become the de facto standard protocol and the various CORS (Cross Origin Resource Sharing) protections are also quite common, the extension has no added value. I recommend the SkipDNS service, which is extension-free and even works on mobile devices, with no prior setup required by the other people you want to share the preview link with.