There are couple of issues. Notice the similarity between you watching the porn (you watching other people having sex) and you experiencing nightmares (you also watching other people having sex). You don't participate in either activities, you are only watching... Dreams are simply fulfilled wishes, your mind still have that desire for sex... But it's frustrating and depressing because you can't get it, respectively you don't get sex in real life and at the same time you no longer watch porn which you used to for many years...
Why do people love sex? Drugs, food, alcohol, cigarettes, sweets, porn? Because these things brings us pleasure. When you watch porn, when you have an orgasm, you feel great, it's the most pleasurable feeling you can experience. When other person eats food, he or she feels great. When another one feels down, depressed, he takes some drugs to feel better. When somebody is anxious he takes alcohol, and suddenly he feels much better, calmed, relaxed,...
Many people get easily addicted because we simply want to feel better, we want that pleasure again and again. But there is a problem, our brain gets used to the original stimuli, next time it will need more to experience the same level of pleasure. When a healthy guy gets anxious, all he needs at first is one beer. Then he needs two, then he starts with liqueur, and five years later he ends up drinking bottle of whiskey daily, now he is full blown alcoholic. When a healthy girl is depressed, she takes a cookie, the sweetness makes her feel better. Then she takes another cookie, and another one again, and each time she feels better. After 10 years she is still eating cookies, but now she is 150 pounds heavier and just was diagnosed with diabetes.
When a guy starts with porn, all he needs at first is a picture of naked women. Then he adds light and short movie, then he adds more and more, and after couple of years he is jerking off couple hours every day to any kinds of porn. He also became heavily addicted.
Now, we don't just get rid of our addictions so easily. The reason is, that once we get used to some substance that causes us great pleasure and we suddenly stop, our mind and body goes to withdrawal. Withdrawal is the opposite of pleasure. If the person is alcoholic he might experience severe anxiety, maybe seizures, he can even die of the withdrawal symptoms. Similarly with people who are using drugs. If the girl who was addicted to cookies and food goes suddenly on diet, she might experience heavy depression because now there is nothing what makes her feel better. Maybe she even starts smoking, because smoking is just another substance that causes pleasure...
See the pattern? It is similar, if not the same with porn. When you get addicted, when you watch porn for years and then stop, you basically remove pleasure from your life. Your brain desires the same pleasure as it was used to, and if it can't get it it falls into depression. In depression, you have low energy, you don't feel like doing anything, you don't want to talk to anybody, you don't want to exercise, you may gain weight by overeating, you may have nightmares in which you simply desire to watch other people having sex again... Then because you just watch but not do, you feel even more frustrated, you might feel lots of guilt by being porn user...
As suggested above, it is good if you can quit at will and simply change your life. This however doesn't work for everybody as different people experience different intensity of addiction, as they have different cravings for that particular stimuli that causes pleasure... Many people try to quit (smoking, alcohol, drugs, food, porn,...) and they keep relapsing and relapsing... The reason is simply that once they quit the pleasure they go to severe withdrawals, and if they don't substitute the pleasure with something else they just suffer with depression...
So the solution for you is to find something that replaces the pleasure caused by porn. The difficulties may arise, however, because porn (sex) is very intensive pleasurable experience, and other activities may not fully replace it. Therefore you should develop strong frame to deal with it, and then follow it till it becomes habit. This is just an example what I would do:
1. Decrease the amount of porn gradually, say 3-4 times per week, then to 1-2 times per week. At the same time, try not to develop guilt by blaming porn, try to avoid "hating pleasure". If you already quit, good
2. Exercise, lift weights, go for walk, whatever. Simple walks 3-5 miles per day may give you lots of positive ideas
3. Friends, social circle. In stead of running home and falling into depression, get together with other guys
4. Avoid substituting porn for bad habits such alcohol, smoking, drugs, food... Many times it is tempting, perhaps you may not even realize that "suddenly" you are drinking more and more. So simply monitor your habits, avoid the bad ones
5. Avoid negativity. Reading your text you seem pretty negative. It's of course just text on the internet so it could be misleading, but IMO you do have underlying depression. You are also frustrated, so work on developing positive mind frame. If you have depression, maybe you don't want to be a hero - what can take you 5-10 years on your own to get out of it can take some professional couple months, if not weeks
6. Another "good substitute for pleasure" is spirituality. There used to be time when I would bite my tongue off before I would say it, but today it seems like very good approach. If you believe in God, good, believe more (without becoming an extremist, LOL). If not, look into some eastern philosophies, Bhakti yoga, Bhagavad Gita,... You don't need to believe in God to live spiritual life. If nothing else, spirituality will help you to develop positive mind
7. Girls, of course. Go out and socialize. Note however that with negative mindset, negative attitude and depression you may not have success as girls usually avoid negative persons, which can further cause more and more frustration. Nobody wants to be around person who drags them down. If you don't feel like being around girls, well, girls will feel exactly the same, they will be avoiding you. On the other hand, people love to be around someone who is positive, enthusiastic and optimistic. Take it slowly, step by step...
So it is like a vicious cycle, it may be difficult to break out of it but it is definitely possible especially if you have good plan. Create some short to intermediate plan of action, between 4 weeks and 6 months, follow the plan daily and then re-evaluate it...