Very difficult. I would say, get everything sorted so you can go then just tell him. You don't want to be hanging around in the same house with him begging you to stay because you haven't got anywhere to go. But the sooner you can be open about your decision the better.
Clearly part of you doesn't want to hurt him so I would consider the following:
Don't do it by having an affair because you can't just tell him, which is what a lot of women do.
Try to look out for him and make sure he has friends and relatives to support him, as it will be a difficult time. It is much harder for men than for women to find a ready circle of friends to support them.
Think carefully about the damage it will do to him and perhaps to your son if his friends, family or colleagues find out about his porn/webcam problem - consider whether the two of you can agree some other
grounds for divorce if (once he's had a chance to calm down, perhaps) he can be reasonably co-operative.
Let him have fair access to his son - boys need their fathers to be a significant part of their lives.
Remember that your son is less likely to be damaged by the divorce if you can build a friendship with your ex and behave nicely to each other. That is most likely to happen if the divorce is fair, both financially and in terms of access.
As far as possible try to agree as much as you can between yourselves without recourse to solicitors. They tend to make their money by stirring up animosity in these situations.
Hope that helps. As for telling him, you've got to just find a time and say it to him, face to face, in a grown-up way.