I am trying to implement Server sent events in Expressjs project. Now, I created a socket connection using net api of NodeJs. I am getting streaming responses in socket. My doubt is when I try to send the streaming responses using res.send() , it says
Error: Can't set headers after they are sent.
My another doubt , what do I specify inside new EventSource(??) to successfully connect to that socket that is running in nodejs. Now I have written my server code in controllers folder !!
Any clarifications will be largely helpful !