Is there an LGBT group at his school? My DS started one. It met once a week and always with a supportive teacher present. They had a great time. They took turns discussing LGBT people they admired in all walks of life, and discussing their own concerns. And they had good cake and croissants!
In general, draw his focus away from online stories of being beaten up and towards online stories of successful and happy gay men - happily married gay men, gay company leaders, actors, medics, artists, lawyers, politicians, social campaigners. Help him broaden his scope - he is a whole human being with a wide range of qualities who is also gay.
Can you look online for some gay discos and cafes that he could go to locally to meet age-appropriate LGBT friends. Are there groups outside school that are likely to be more inclusive? A drama or rock music or art group?
And - very important - do a lot of CBT-style support. He gets called names. Evaluate that situation. Who does he judge in that situation - the person doing the name calling or the person being honest about who they are? The opinions of lesser mortals should start to slide off him easily with a bit of practise. We all need to learn this. Bullies will seek something to scorn in everyone. Reassure him that not only gay people have to learn to teflon-coat themselves against scathing personal putdowns - all women, POC, small men, SEN and physically disabled people, anyone who is brighter or less academically able than average, etc etc. It's a life skill.
Physical attacks are something else - and he has every right to go about his life feeling safe. If anyone attacks him physically, assure him the police will be informed. And if he wants to feel safer, no harm to taking up a martial art, boxing and weight training. My DS is small, slim, very geeky and openly gay but also national level at a martial art. I think it gives him a natural 'don't mess with me' vibe, even though at a glance he is a walking target for aggressive homophobes.