The incident happened outside Squire's carpet shop on Victoria Road at 6.39am on Friday.
The suspect, who was bare chested and wearing tracksuit bottoms, was reported to have violently confronted the off-duty officer and tried to throw a bag of vomit over him.
He was initially restrained by the victim and another fellow off-duty officer who had noticed the disturbance and realised his colleague needed assistance.
Officers on patrol then arrived at the scene and the suspect was placed into a police van and taken into custody for questioning.
A 26-year-old man was arrested on suspicion of assaulting an emergency worker.
Witnesses or anyone with information that could assist the investigation are asked to call North Yorkshire Police on 101, select option 1, and speak to the Force Control Room.
Information can also be passed on anonymously via Crimestoppers on 0800 555111.
Anyone who calls should quote reference number 12200054533.