Developing a suitable framework for real-time optimal power flow (RT-OPF) is of utmost importance for ensuring both optimality and feasibility in the operation of energy distribution networks (DNs) under intermittent wind energy penetration. The most challenging issue thereby is that a large-scale complex optimization problem has to be solved in real-time. Online simultaneous optimization of the wind power curtailments of wind stations and the discrete reference values of the slack bus voltage which leads to a mixed-integer nonlinear programming (MINLP) problem, in addition to considering variable reverse power flow, make the optimization problem even much more complicated. To address these difficulties, a two-phase solution approach to RT-OPF is proposed in this paper. In the prediction phase, a number of MINLP OPF problems corresponding to the most probable scenarios of the wind energy penetration in the prediction horizon, by taking its forecasted value and stochastic distribution into account, are solved in parallel. The solution provides a lookup table for optional control strategies for the current prediction horizon which is further divided into a certain number of short time intervals. In the realization phase, one of the control strategies is selected from the lookup table based on the actual wind power and realized to the grid in the current time interval, which will proceed from one interval to the next, till the end of the current prediction horizon. Then, the prediction phase for the next prediction horizon will be activated. A 41-bus medium-voltage DN is taken as a case study to demonstrate the proposed RT-OPF approach.