Giter Club home page Giter Club logo

arcusnode's Introduction

ArcusNode Media Server

This is a customized version of ArcusNode. Changes will be listed here.

  • RTMFP commands no longer require a return value. This was a synchronous (blocking) function. The commands are now async and require a callback.
  • RTMFP commands are now handled FMS-style. The commands used to be handled at the service level (regardless of client connection and application). The commands are now handled per-netconnection, so a NetConnection with different credentials may be bound to a different function for the same command (or no function at all).

TODO:

  • Handle applications FMS style
  • Make the commands easier to use (handle possible context problems)

The old README below:

ArcusNode

A RTMFP Rendevouz Server For Peer Assisted Networking With Adobe Flash on NodeJS

ArcusNode aims to assist P2P networking with ease of extendability due to Javascript glue with NodeJS. ArcusNode is a standalone RTMFP implementation. We want to thank Cumulus, a standalone C++ implementation of the RTMFP Protocol and much more.

Author: arcusdev [[email protected]]
License: GPL

Issues

If you have an issue with ArcusNode, please use the Github issue tracker!

Status

ArcusNode is still under heavy development and much work remains to be done. It covers the following features already:

  • P2P Rendezvouz service
  • NetGroups
  • Remote Methods / Commands
  • Authentication
  • Plugins

Build & Installation

ArcusNode runs on Node v0.5.5 and higher. To use ArcusNode as a service, get it from github and run:

$> node-waf configure build
$> node service.js

You then should see something like:

Starting up ArcusNode RTMFP Service.
Copyright (C) 2011 OpenRTMFP
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
(For usage help type "node service.js -h")
ArcusNode RTMFP Service running at 0.0.0.0:1935

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.

Cygwin

If you run into problems building node on Cygwin, checkout https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows). If you consider using rebase, use both ./rebaseall and ./perlrebase.

Usage

Basic

As you can see in the service.js, it is very easy to use ArcusNode in your own project.

var ArcusNode = require('./lib/arcus_node.js');
var arcusService = new ArcusNode();
arcusService.run();

Customization

ArcusNode uses a mixture of Events and registered command callbacks. Events behave like known Node core events. Commands are called by a connected client through its NetConnection#call and can be registered on ArcusNode. Commands on the server behave almost exactly the same as described in the Flash Documentation, except that ArcusNode command callbacks always get the NetConnection which called the command as first argument, then the arguments from the Client.

Events

At this moment, ArcusNode emits the following events:

  • start
  • stop
  • handshake
  • connect
  • disconnect
  • command

ArcusNode uses the Node EventEmitter API

Example for a connect event listener:

var ArcusNode = require('./lib/arcus_node.js');
var arcusService = new ArcusNode();

arcusService.on('connect', function(nc, obj){
  console.log('Received a connection request for Connection ' + nc.id + ' with the properties', obj);
});

arcusService.run();

Commands

[todo]

Example for a command Client side:

var responder:Responder = new Responder(function(response) {
  trace(response.what); //-> 'ArcusNode rocks!'
});
connection.call('sayWhat', responder, { name: 'ArcusNode' });

Example for a command Server side:

arcusService.onCommand('sayWhat', function(nc, obj){
  return { what: obj.name + ' rocks!' };
});

ArcusNode Settings

The ArcusNode constructor takes a settings object with the following attributes:

.port
  Type: Integer
  Default: 1935
  The port that ArcusNode will listen for UDP connections.
  
.address
  Type: String
  Default: ''
  ArcusNode can be run on a specific interface if wanted.
  
.logLevel
  Type: String
  Default: 'warn'
  Can be one of ['fatal', 'error', 'warn', 'info', 'debug'].
  
.logFile:
  Type: String, path
  Default: ''
  If a path for a log file is specified, all logging will be written to that file.

.manageInterval 
  Type: Integer, seconds 
  default: 60 
  The interval for the management cycle to do cleanup

.connectionTimeout 
  Type: Integer, milliseconds 
  Default: 120000 
  The timeout for a NetConnection. The connections is dropped after the NetConnection was unused for that amount of time. 

.groupTimeout
  Type: Integer, milliseconds
  Default: 360000
  The timeout for a NetGroup. The group is dropped afer there was no interaction for that amount of time.

.serverKeepalive
  Type: Integer, milliseconds
  Default: 60000
  The timeout before the server sends a keepalive command to the client.
  Should be less then connectionTimeout.

.clientKeepalive
  Type: Integer, milliseconds
  Default: 60000
  Will tell the client in what interval it should send keepalive messages

.maxKeepalives
  Type: Integer
  Default: 3
  How often to max keepalive the connection before dropping it.

Roadmap

To reach version 0.1:

  • Add testing scripts and a Flash testing project
  • Complete AMF reading/writing (70%)

Development

If you have ideas, suggestions, bugfixes or just want to yell a little at the author, feel free to contact [email protected]

© Copyright 2011 OpenRTMFP

arcusnode's People

Contributors

arcusdev avatar eden avatar maxvyaznikov avatar mihaiene avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.