Being a bit pissed off or jealous in a situation like this is normal, how you deal with it is another matter. It is much better to try and clear the air and talk to both of them, if you feel that you might go over the top do it in a semi public place. Like a semi secluded place in a park or public plaza, you will be much less likely to boil over in my experience.
If they are honest and she does feel that she is getting closer to the next guy you will have to just suck it and move on, you can do little to salvage the situation. Make it clear in the conversation that you understand that may be a possibility and can accept it. Or the other option in this case and depending on how close to her and how much of a friend your friend is you could have an open relationship, this isn't for everyone but if you feel you could handle that it may be a suggestion. It can even be... entertaining in certain circumstances if you all feel comfortable with some experimentation. Never knock something until you have tried it, you would also be free to cast your net a bit wider and meet other partners.
If nothing funny is going on just explain how uncomfortable it makes you feel, then you just work it out. Either you try and get more comfortable with the flirting and body contact assured in the knowledge that nothing is going and its just the way they are or you can express how difficult it is for you to cope with it and ask them too stop. After that if it continues you may want to consider breaking up if its a real problem for you, getting frustrated and jealous will turn things very sour and bitter over time. Better to make a clean break and get it over rather than risk a poisonous relationship. If they are being dishonest and something is going on just break contact with both, no other way to handle that in a civilized way and can turn ugly fast. Fists often get involved then, they are not friends worth having if they do that to you.
You will either have to salvage your relationship with the dude or accept the friendship is over, how you handle that can be as hard as breaking up with your girlfriend if he was a good mate.