Transparent proxy addon

Hello,

I’m new to kodi dev and more generally to python. I’d like to get advice regarding the relevant way to use a transparent (local) proxy.

My first though is that i could develop a service addon to call a python script running a local proxy to filter some requests done by an other kodi’s addon. As a side note, the current addon i’m talking about already allows proxy setting from its config panel.
But i’m really not sure this could be done this way.

A more relevant way would surely be to run this proxy script at OS level but i’d like to avoid it if possible. I’m currently using OSMC on rpi3.

So, does service addon (or any other addon type) can be used for this purpose?

Feel free to ask me question if mine isn’t clear at all.

Regards.