The best case would be if your internet connection ITSELF whitelisted out porn/viruses. Apart from massive government intrusion--and criminal penalties from circumventing your assigned whitelist--the best you can do is fix your modem/ISP connectivity (anything device side is trivial to circumvent).
It SHOULD be trivial to have a whitelist operating via a hardpoint like your modem or your ISP. But sadly, the market does not offer such options--and enabling your ISP to block any particular traffic means they have to sniff it ALL out.
But the reality is: you can just buy a different modem or ISP.
And if that isn't the case, you can just stare at women in bikinis at the beach or the nearby pool... or the slightly short/tight skirt or loose blouse of your co-worker... or the professionally dressed news caster on TV... or pictures of Mother Theresa in her habit.
Well, maybe if you wean yourself down to nuns in habits, I suppose you might be cured.
But the reality is that you are under a spell, and you don't quite realize it. Call it sin, call it "not a struggle against flesh and blood but against powers and principalities," call it addiction, call it some psychological/emotional disorder....
No matter what, you are under a spell, a trance, a stupor... like the spell the King of Rohan was under by Wormtongue in Lord of the Rings. It IS poison that you drink daily, but you haven't really woken up to the fact.
The power of addiction is that it convinces you that it isn't really there, or that it really isn't self destructive. And everytime you go back to it, it gets to keep whispering its lies and pouring its poison into your ears while you sleep, and while you stumble half-awake otherwise.
So... you either need to so fully suffer a tragedy so immense that it snaps you back into full consciousness and gets you seriously down the road of recovery, or you need to get maximally aggressive in getting away from it so you can CLEAR YOUR HEAD.
What I had to do? Get rid of my computer and internet access altogether, except under extremely controlled settings in public with accountability.
It's hard to imagine surviving without the computer and IoT, but humans managed to do without it for 50K to 6.5K years (depending on your faith).
That's the realization I had to get to, and from what I read, my "addiction" was about as light and controlled as yours. Still, at this point, I can see how it was continually poisoning my mind, clouding my thoughts, lulling my senses, turning all consciousness into a constant search for the next hit from the slightest curve or cleavage.
F' that man! There's so many more wonderful/terrible/thrilling things to notice and experience in the world.
Very few escape our sexuality and primal/primary drives, but we don't have to be slaves to them!
Do whatever is necessary to get completely clear for 30-90 days to let your brain start to rewire. You will notice a huge change after just a week!
P.S. Video games are a big problem too. Get clear of the junk.