Multiple proxies
Setting up Multiple Proxies
If you want to have something where users can change a setting to swap what proxy does the proxying. There is multiple ways to do it.
Single ServiceWorker
Its possible to combine all of your proxies into 1 ServiceWorker. However if it is not done correctly, it can cause your entire proxy system to become broken. The way this functions is it checks the path you are requesting to, and determines the proxy to be used from there. A typical setup looks like this:
The example above was found here. An example of a Proxy site that uses this system is Nebula
Many ServiceWorkers, 1 Register
This system works like this, you have multiple proxies with each of them having their own ServiceWorker. What changes the Proxy is something like a LocalStorage variable. This is usually a safer method as long as the list is formatted correctly and all the information that it uses for it is correct. A typical setup looks like this:
Ways to use the Many ServiceWorkers, 1 Register System with non-SW Proxies
Usually if you want to use a non-SW proxy like Rammerhead with this system, you’d have to use a if, then, else statement and do something like this:
This method and example was made by Night Network. An example Proxy that uses an advanced version of this system is Space