I lived in the midwest. The town sizes ranged from 3000 to around 50k. I've never really had more than 2-3 friends at once, and sometimes didn't have that. My ex wound up with schizophrenia, but that's another story altogether.
I started being lonely at 10 or 11. That's only gone away in the last 6-10 years. Regular internet meant I've met folks I can simply be myself with. I moved - across an ocean - to be with one of those folks. I'm rarely lonely anymore, even with the internet. Even with the language barrier. Even with my weirdness.
For the first time in my life, here I feel like I kinda belong, and it is a mix of offline and online stuff. I'm even in a country that is "difficult" for folks to make friends with - or at least they say it is. On the other hand, it actually fits my personality better.
I don't find it hard to talk to folks online. Male or female (I tend to have more male friends than female, and don't care about the distinction. My male spouse is the opposite). sure, some folks are simply there to flirt, but I can shut them down pretty quickly.