This server is an example framework to test against and is not the final product. It is designed so that the id lookup is replaceable.
Run the server by using
node server.js <port number>
so for example this will run the UDP listener on port 3000.
node server.js 3000
UDP packets sent to that port will be used to verify the hashed id. The id is a concatenation of a salt and the id and md5 sum, hex encoded. In pseudo-code:
md5sum("salt"+"id")
Therefore:
md5sum("foobar")
Will be: 3858f62230ac3c915f300c664312c63f
This is concatenated with a source number as a string and a colon. For doorbot this should be 1. So the whole packet contents will be:
1:3858f62230ac3c915f300c664312c63f
The server does it's checks and then will send a packet back on the same port that it received the request from.
The response comes in a string that contains the id of the server (0) a colon, the hash that was requested, another colon and an allow value (1) or disallow value (0).
So the two likely responses you will get are disallow:
0:3858f62230ac3c915f300c664312c63f:0
And allow:
0:3858f62230ac3c915f300c664312c63f:1
This test client allows you to quickly verify if the values you are sending will work. It takes a port as the first argument and the message as a second argument. For simplicity it runs in broadcast mode so you don't have to worry about hooking it up to the server although you may have to worry about what you're sending across your network.
Bear in mind that the client is not smart enough to listen once it has sent a message, but you will get visual indicator on your server.
An example:
node test-client.js <port number> <message>
A working example:
node test-client.js 3000 "hello world"
A verifiable example. We use 0 as the source here as it is coming from the server.
node test-client.js 3000 "0:3858f62230ac3c915f300c664312c63f"