First, you must be using a version of the software that supports the socket server. All versions after and including 1.1.18 included the socket server, but the current documentation and sample code only applies to the latest software release.
Check that you are using the most recent software release:
Open Options Menu
Open Developer Tab
Check box to enable socket server.
(platform specific) accept firewall changes
trello ID: 5615390cb22fd44d4ccedc6f