The detection of high-energy neutrino coincident with the blazar TXS 0506+056 provides a unique opportunity to test Lorentz invariance violation (LIV) in the neutrino sector. Thanks to the precisely measured redshift, i.e., $z=0.3365$, the comoving distance of the neutrino source is determined. In this work, we obtain and discuss the constraints on the superluminal neutrino velocity $\delta_\nu$ and the LIV by considering the energy loss of superluminal neutrino during propagation. Given superluminal electron velocity ($\delta_e \ge 0$), a very stringent constraint on superluminal neutrino velocity can be reached, i.e., $\delta_\nu \lesssim 1.3\times 10^{-18}$, corresponding to the quantum gravity (QG) scale $M_{\rm QG,1} \gtrsim 5.7 \times 10^{3} M_{\rm Pl}$ and $M_{\rm QG,2} \gtrsim 9.3 \times 10^{-6} M_{\rm Pl}$ for linear (quadratic) LIV, which are $\sim 12$ orders of magnitude tighter for linear LIV and $\sim 9$ orders tighter for quadratic LIV compared to the time-of-flight constraint from MeV neutrinos of SN 1987A. While given the subluminal electron velocity, a weaker constraint on the superluminal neutrino velocity is obtained, i.e., $\delta_\nu \lesssim 8 \times 10^{-17}$, which is consistent with the conclusions of previous works. We also study the neutrino detection probability due to the distortion of neutrino spectral shape during propagation, which gives slightly weaker constraints than above by a factor of $\sim2$.