Hi User42
I'm going through the same feelings you are. Although I am in a great relationship and do have friends, I am constantly plagued by loneliness and I feel like my friends aren't close to me anymore. Sometimes I feel like it would be less painful to just not have any friends to begin with than to have superficial relationships that just disappoint you.
I know you may think that your situation is a lot worse, and I'm not here to tell you that it's not. But loneliness and feeling alone/sad/upset/rejected can happen to anyone - even those who have it all. I don't have any solutions yet to anything, but I just want you to know that you're not alone.
One thing that I did take up was writing a journal entry each time I felt upset or sad. It's more so for myself to help ease any negative emotion I may be overcome with at the moment. It doesn't solve anything of course, but it does help. Sometimes I find myself trying to coach my way out of the funk in my journal and I give myself hope. Another thing I do is to try and think of things from an outside perspective. If someone I care about was going through what I was, what would I say to them?
I hope things do get better for you and just know you're not alone. You are important! You just need to find your place in this world and create your own niche. In the meantime try and stay positive and try volunteering so you can meet other people and involve yourself in something you love. It helps.