This may be quite an advanced feature at this point, haven’t heard of too many developers doing networked games at the moment. Building UE4 from source for potential needed changes is definitely good to have here, I think. This may need to dig into the sources for some adjustments.
If you’re looking to do all the networking communication manually in JS code via WebSockets, and have UE4 only call out to your JS code to synchronize state, then you could try looking at something like HTML5 Content: Control Browser From inside UE4 - Platform & Builds - Epic Developer Community Forums to get tips for bidirectional communication. That might give ideas how to marshall data back and forth the JS<->engine boundary. In JS land, you can use whatever web apis you want to as usual, so e.g. WebSockets related documentation then applies directly.