Your AI players can run on your server and just connect to the server (on the same box) with a webSocket connection. Your server doesn't even need to know if they are AI players or real players. As far as the server is concerned, they are webSocket connections that come from somewhere (it just so happens that some of them come from the same box rather than a distant browser). In this manner, the server doesn't need to treat the AI players any differently than the regular players (unless you choose to invoke different logic for each to favor one over the other).
So, there's no need to use a fake socket. You can more easily just use a real webSocket connection and then there's no socket pretending required.
See this other question/answer for how to create a socket.io connection from your server:
Is it possible to set up a socket.io client running (server-side) on a node.js server?
In summary, you use the socket.io-client
module:
var io = require('socket.io-client');
And, then use the io
variable like you would from the browser client.