Connect a cluster on a single machine. One node starts a server on a given port, but if the address is in use, become a client, and connect to that port instead.
Also, if the current server goes down, another node will become the server.
If running in the browser, tab-stream is used instead of net.
This is the code for both the server and the client.
var autonode =