The heteroclinic bifurcation and chaos of a Duffing oscillator with forcing excitation under both delayed displacement feedback and delayed velocity feedback are studied by Melnikov method. The Melnikov function is analytically established to detect the necessary conditions for generating chaos. Through the analysis of the analytical necessary conditions, we find that the influences of the delayed displacement feedback and delayed velocity feedback are separable. Then the influences of the displacement and velocity feedback parameters on heteroclinic bifurcation and threshold value of chaotic motion are investigated individually. In order to verify the correctness of the analytical conditions, the Duffing oscillator is also investigated by numerical iterative method. The bifurcation curves and the largest Lyapunov exponents are provided and compared. From the analysis of the numerical simulation results, it could be found that two types of period-doubling bifurcations occur in the Duffing oscillator, so that there are two paths leading to the chaos in this oscillator. The typical dynamical responses, including time histories, phase portraits, and Poincare maps, are all carried out to verify the conclusions. The results reveal some new phenomena, which is useful to design or control this kind of system.