Skip to content

03. Connection Filtering

Zomboided edited this page Dec 30, 2022 · 10 revisions

VPN Manager can be configured to automatically switch connections based on either the add-on being used, or by the secret magic Kodi window ID. For the majority of users add-on filtering will be enough. For some users with specific needs then windows filtering can augment add-on filtering, but will require more complex set up.

Filtering can be paused using the option in the add-on menu. This will allow a different VPN to be used temporarily without needing to change the filtering settings.

Depending on the revert setting, after you leave a filtered add-on or window the previous VPN state will be returned to (either connected to another VPN location or disconnected).

Add-on Filtering

To set up addon filtering, go to the Settings/Add-on Filter tab.

If you want to disable your VPN for certain add-ons, then click the 'Excluded' option and highlight the add-ons that should be run without a VPN. If you want to use specific VPN connections, then select 'First' to 'Tenth' and define which validated connection will be used for which addon. You can have the same add-on against multiple connections - if this is the case then it'll use the current connection if it's valid, otherwise switch to the lowest numbered connection.

When you run the add-on, after a short delay a Disconnect/Connecting/Connected notification box will appear to indicate that the VPN connection is being changed (unless you're already using that connection). A log entry will also be made to indicate the reason for the change in connection.

You've probably noticed that not all add-ons will be available to filter. This is dependent on the add-on type as set up in it's addon.xml file, as well as having a detectable add-on window that's used to display the contents of the add-on (so scripts wouldn't work here for example).

Window ID Filtering

Understanding Window ID Filtering

Before you set up window ID filtering, you should appreciate what a window ID is. Kodi relates an ID number to each of the windows that it displays. Some add-ons use one or more 'standard' Kodi windows (an example would be the BBC iPlayer video add-on which will just display its content in an existing Kodi window, and when playing video it'll use the default full screen video window). Other add-ons use their own windows to display customized content (an example here would be iVue TV Guide's program guide).

Add-on filtering will take precedence over window ID filtering. It is entirely up to the user to ensure that any filtering they set up will not conflict, causing multiple connections and disconnections.

To set up windows filtering, go to the Settings/Window Filter tab.

Determining a Window ID

The first option on the Settings/Window Filter tab is an option to 'Display window IDs as a notification'. Turning this on will cause notifications to pop up when the window ID changes. You can use this to determine whether you can identify a window ID to filter on in order to make a connection change.

You should note the high level common windows (currently 10000 is home, 10025 is Movies for example) and the special windows (12005 is full screen playback) and avoid filtering these. If you do filter these, you'll likely see unnecessary thrashing of the VPN connection between locations and states.

Window IDs may change between Kodi releases, at which point you may need to revisit your filters again.

Alternatively the Kodi wiki has a list of window IDs. I'm not sure it's kept up to date with all of the IDs but it might be a good guide to determine what's possible.

When you've identified the window IDs you're interested in, disable the 'Display window IDs as a notification' option.

Setting Up Window ID Filtering

To set up filtering, click on 'Excluded' or 'First' - 'Tenth'. As with add-on filtering this will let you determine which window IDs require the VPN to run disconnected and which window IDs require particular VPN to be used.

After clicking on a filtering option you'll be shown a list which will include any existing window ID filters, and some further options in italics. Clicking on an existing filter will let you edit or delete it. 'Add single ID' will let you enter a new single window ID to filter on. 'Add range of IDs' will let you enter a new range of window IDs (a good use of this would be to filter all of the different Live TV windows in the 10600 - 10620 range against a particular VPN). All IDs must be 5 numbers and ranges must be low to high.

As with add-on filtering, when a match is found a notification box will appear indicating that the VPN connection is changing and a log entry will be made indicating the reason why.

Using VPN Only When Needed

If you only want to use VPN for specific add-ons then disable automatically connect to first VPN. You can then use add-on filtering to connect the VPN when you enter the add-on. The VPN will not disconnect on exit for these reasons, but will return to an appropriate state next time a different add-on is selected. If you want to return to a disconnected state then you can use window filtering to exclude the home window ID (10000) or others of your choice. It's up to you how to manage this as it may cause the connection to connect/disconnect too often.