oldj / SwitchHosts

Switch hosts quickly!
https://switchhosts.vercel.app
Apache License 2.0
23.75k stars 2.49k forks source link

Toggle between two IPs? #758

Closed simonmeggle closed 2 years ago

simonmeggle commented 2 years ago

I have the need to reach "foohost" under two different IPs with the same host name.

location A => foohost = IP A
location B => foohost = IP B 

(location B is from external, where I use the great zerotier network)

I am unsure how to solve this with SwitchHosts. My initial idea was to define foohost in "System-Hosts" with IP A and then to define a new entry for IP B. And my first naive expectation was that the B entry will simply overwrite the A entry, if activated.

But by default only the first entry matches (IP A). Even the configuration option "remove duplicated" does not help, because it comments the desired second entry (IP B).

Creating two entries for IP A and B seems like overkill because it requires me to remember that they can only be used exclusive (A OR B).

Question: What is the recommended way to implement this toggle with just 1 switch?

Side question/feature request: did you think about another option:

oldj commented 2 years ago

Have you tried the single choice mode?

CleanShot 2022-10-10 at 16 51 23@2x

Creating two entries for IP A and B, and set the choice mode to Single, when you open one entry, the other entry (or the rest entries) will be closed automatically.

simonmeggle commented 2 years ago

...I knew there is a solution :-) Thanks, works as expected! 👍