been there, lost my whole life because of it - Steps to Take:
1. Never, from this point on, say ONE negative thing about your boyfriend to your friend - not even if it's a little annoyance. She will take that as a sign of his and your discontent even if being annoyed with each other is normal. Just don't share this with her.
2. If she says how wonderful he is to you, tell her you totally agree. Don't fall into the the trap of "Well, yes sometimes, but he...blah da de blah" Don't do that. Let her know in no uncertain terms (subtly or overtly that this boyfriend is the love of your life, if indeed he is).
3. If, in the past, you've started to "up-sell" your friend to your boyfriend or talk about how you wish you were as unselfish or giving or pretty as she is, STOP doing that. Pretty soon, he'll start to agree with you! Not that you want to emphasize her flaws because that would be unkind, but you might want to hint at an imperfection or two of hers. At the very least, don't praise her to high heaven.
3. As hard as it may be, start distancing yourself from this friend (either a little bit or a lot)
4. Start putting up reminders of your love around your place - a picture of the two of you from the past. Get a lovely frame for it and place it in a prominent place.
5. Keep talking with your boyfriend about your shared fun times.
6. If this is the man you want to marry, be sure you're listening to his needs, his depression, his concerns.
7. Try a new sport or interest together now. I had a friend who was on the brink of divorce and she and her husband started taking sailing lessons. Six months later, they were re-bonded and never spoke of divorce again.
Understand that any friend who lets herself, and I do mean LET'S herself be attracted to another woman's man, has deep issues of insecurity and the need to show superiority. It is a CHOICE. Honorable women make the choice to stop those feelings. You need your own self worth to be iron strong at this point and realize you would never do that to her. Carry that inside of you and you'll notice that dignity when you are with her.
Unlike your situation, mine happened in a 20 year marriage with children involved - nothing but chaos and sadness ensued for all concerned - a tragedy that need never have happened, and I wonder whether it could have been prevented if I had had the self-esteem to take the actions I described above.
All good wishes, Billie