lib7f
7F protocol library for Node.js
Usage
npm install 7f
Server
lib7f = require "7f"server = serveron "client" clienton "message" consolelog msg header = nr: 1 advancedHeader = logicalNr: 1245 command: lib7fconstantsCommandTO type: lib7fconstantsDataTypeBYTEARRAY count: 3 data = 7 msg = headeradvancedHeaderdata clientsend msg serveron "reconnect" consolelog "client has reconnected" serverconnect -> # the server is ready
You can also specify the port, the server address to which the server should be bound to, the servers specification number and it's login function ID:
server = host: "192.168.10.30" port: 5010 specificationNr: 8 loginFunctionId: 5
Client
lib7f = require "7f" client = 7 host: "192.168.0.100" port: 5010 specificationNr: 3 loginFunctionId: 9 clienton "message" consolelog msg header = nr: 4 advancedHeader = logicalNr: 54 command: lib7fconstantsCommandFETCH type: lib7fconstantsDataTypeWORD count: 9 data = 33 msg = headeradvancedHeaderdata clientsend msg clienton "error" consolelog "something went wrong" clienton "login"-> consolelog "client is now logged in" clienton "connect"-> consolelog "client is connected" clientlogin clienton "disconnect"-> consolelog "client is now disconnected" clientconnect
License
GPLv3