title: How to use websockets in Next js
body: <p>I am using Next js for server sider rendering of my application. However, I also need to connect to the Gamesparks library(for authentication) which uses websockets. Every time I try to add my script to the head tag, I get errors that it's not working. Is it possible to use websockets in Next js? I've seen a lot about socket io, and was considering it, but I'd have to re-write the attached library. I'm also curious, should I instead attempt to do my own backend Express server to manage these connections?</p>
  
  <p>As you can probably tell, I'm new to web-development so any resources or suggestions would be appreciated!</p>
  
  <p>The error message from the browser is <a href="http://localhost:3000/gamesparks/gamesparks-rt.js" rel="noreferrer">http://localhost:3000/gamesparks/gamesparks-rt.js</a> net::ERR_ABORTED 404 (Not Found)</p>