/README.md

http://github.com/OpenRTMFP/ArcusNode · Markdown · 173 lines · 135 code · 38 blank · 0 comment · 0 complexity · c4590e4fd7ec8f5f572a552e13692627 MD5 · raw file

  1. # ArcusNode
  2. #### A RTMFP Rendevouz Server For Peer Assisted Networking With Adobe Flash on NodeJS
  3. ArcusNode aims to assist P2P networking with ease of extendability due to Javascript glue with NodeJS.
  4. ArcusNode is a standalone RTMFP implementation.
  5. We want to thank [Cumulus](http://github.com/OpenRTMFP/Cumulus), a standalone C++ implementation of the _RTMFP Protocol_ and much more.
  6. Author: arcusdev [arcus.node@gmail.com]
  7. License: [GPL](http://www.gnu.org/licenses/)
  8. ## Issues
  9. If you have an **issue** with ArcusNode, please use the Github issue tracker!
  10. ## Status
  11. ArcusNode is still under heavy development and much work remains to be done.
  12. It covers the following features already:
  13. * P2P Rendezvouz service
  14. * NetGroups
  15. * Remote Methods / Commands
  16. * Authentication
  17. * Plugins
  18. ## Build & Installation
  19. ArcusNode runs on Node v0.5.5 and higher. To use ArcusNode as a service, get it from [github](http://github.com/OpenRTMFP/ArcusNode) and run:
  20. <pre>
  21. $> node-waf configure build
  22. $> node service.js
  23. </pre>
  24. You then should see something like:
  25. <pre>
  26. Starting up ArcusNode RTMFP Service.
  27. Copyright (C) 2011 OpenRTMFP
  28. This program comes with ABSOLUTELY NO WARRANTY.
  29. This is free software, and you are welcome to redistribute it under certain conditions.
  30. (For usage help type "node service.js -h")
  31. ArcusNode RTMFP Service running at 0.0.0.0:1935
  32. </pre>
  33. 1935 is the default port for RTMFP communication and you should now be able to connect to the server, create groups and get peers connected.
  34. #### Cygwin
  35. If you run into problems building node on Cygwin, checkout _https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows)_.
  36. If you consider using rebase, use both _./rebaseall_ and _./perlrebase_.
  37. ## Usage
  38. ### Basic
  39. As you can see in the service.js, it is very easy to use ArcusNode in your own project.
  40. <pre>
  41. var ArcusNode = require('./lib/arcus_node.js');
  42. var arcusService = new ArcusNode();
  43. arcusService.run();
  44. </pre>
  45. ### Customization
  46. ArcusNode uses a mixture of Events and registered command callbacks. Events behave like known Node core events.
  47. Commands are called by a connected client through its NetConnection#call and can be registered on ArcusNode.
  48. Commands on the server behave almost exactly the same as described in the Flash Documentation,
  49. except that ArcusNode command callbacks always get the NetConnection which called the command as first argument, then the arguments from the Client.
  50. ### Events
  51. At this moment, ArcusNode emits the following events:
  52. * start
  53. * stop
  54. * handshake
  55. * connect
  56. * disconnect
  57. * command
  58. ArcusNode uses the Node [EventEmitter](http://nodejs.org/docs/v0.5.3/api/events.html#events.EventEmitter) API
  59. Example for a connect event listener:
  60. <pre>
  61. var ArcusNode = require('./lib/arcus_node.js');
  62. var arcusService = new ArcusNode();
  63. arcusService.on('connect', function(nc, obj){
  64. console.log('Received a connection request for Connection ' + nc.id + ' with the properties', obj);
  65. });
  66. arcusService.run();
  67. </pre>
  68. ### Commands
  69. [todo]
  70. Example for a command Client side:
  71. <pre>
  72. var responder:Responder = new Responder(function(response) {
  73. trace(response.what); //-> 'ArcusNode rocks!'
  74. });
  75. connection.call('sayWhat', responder, { name: 'ArcusNode' });
  76. </pre>
  77. Example for a command Server side:
  78. <pre>
  79. arcusService.onCommand('sayWhat', function(nc, obj){
  80. return { what: obj.name + ' rocks!' };
  81. });
  82. </pre>
  83. ### ArcusNode Settings
  84. The ArcusNode constructor takes a settings object with the following attributes:
  85. <pre>
  86. .port
  87. Type: Integer
  88. Default: 1935
  89. The port that ArcusNode will listen for UDP connections.
  90. .address
  91. Type: String
  92. Default: ''
  93. ArcusNode can be run on a specific interface if wanted.
  94. .logLevel
  95. Type: String
  96. Default: 'warn'
  97. Can be one of ['fatal', 'error', 'warn', 'info', 'debug'].
  98. .logFile:
  99. Type: String, path
  100. Default: ''
  101. If a path for a log file is specified, all logging will be written to that file.
  102. .manageInterval
  103. Type: Integer, seconds
  104. default: 60
  105. The interval for the management cycle to do cleanup
  106. .connectionTimeout
  107. Type: Integer, milliseconds
  108. Default: 120000
  109. The timeout for a NetConnection. The connections is dropped after the NetConnection was unused for that amount of time.
  110. .groupTimeout
  111. Type: Integer, milliseconds
  112. Default: 360000
  113. The timeout for a NetGroup. The group is dropped afer there was no interaction for that amount of time.
  114. .serverKeepalive
  115. Type: Integer, milliseconds
  116. Default: 60000
  117. The timeout before the server sends a keepalive command to the client.
  118. Should be less then connectionTimeout.
  119. .clientKeepalive
  120. Type: Integer, milliseconds
  121. Default: 60000
  122. Will tell the client in what interval it should send keepalive messages
  123. .maxKeepalives
  124. Type: Integer
  125. Default: 3
  126. How often to max keepalive the connection before dropping it.
  127. </pre>
  128. ## Roadmap
  129. To reach version 0.1:
  130. * Add testing scripts and a Flash testing project
  131. * Complete AMF reading/writing (70%)
  132. ## Development
  133. If you have ideas, suggestions, bugfixes or just want to yell a little at the author,
  134. feel free to contact arcus.node@gmail.com
  135. &copy; Copyright 2011 OpenRTMFP