Not always comes from allergy, all my three children had a history of pink eye, the doctor told me it an infection cause by a virus and yes it is highly contagious.. what I was told to do was applied warm wash cloth to their eyes to remove any discharge and to wash our hands everytime we touch it and also an antibiotic drops will be needed to kill this infection and they did have ointment cream which I had to applied it above their eyes ...They weren't allow to go to school until it was gone, I think it took a couple of days or maybe a week for it to go away....
I hope you feel better, I don't know what it like to have one, but been through this experiences with all my three boys, and it was no fun watching them suffer....