Delta6Labs interview question

How would you make a socket connection between frontend and backend from the same next js app