var connect = require('connect')
    , http = require('http')
    , port = 3000
    , app = connect().use(connect.static(__dirname + '/app'));


// Start the app
console.log('App started on port ' + port);
var server = http.createServer(app).listen(port);

// Configure socket.io for WebSockets
var io = require('socket.io')
            .listen(server)
            .set('log level', 1);

@@ -380,8 +380,1554 @@
 l', 1);%0A
+%0A// A method for sending requests%0Avar sendRequest = function(ipAddress, type, action, command, options) %7B%0A    var url, urn;%0A    if (type == 'command') %7B%0A        url = '/nrc/control_0';%0A        urn = 'panasonic-com:service:p00NetworkControl:1';%0A    %7D else if (type == 'render') %7B%0A        url = '/dmr/control_0';%0A        urn = 'schemas-upnp-org:service:RenderingControl:1';%0A    %7D%0A%0A    var body = %22%3C?xml version='1.0' encoding='utf-8'?%3E %5C%0A              %3Cs:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'%3E %5C%0A                %3Cs:Body%3E %5C%0A                 %3Cu:%22+action+%22 xmlns:u='urn:%22+urn+%22'%3E %5C%0A                  %22+command+%22 %5C%0A                 %3C/u:%22+action+%22%3E %5C%0A                %3C/s:Body%3E %5C%0A              %3C/s:Envelope%3E%22;%0A%0A    var postRequest = %7B%0A        host: ipAddress,%0A        path: url,%0A        port: 55000,%0A        method: 'POST',%0A        headers: %7B%0A            'Content-Length': body.length,%0A            'Content-Type': 'text/xml; charset=%22utf-8%22',%0A            'SOAPACTION': '%22urn:'+urn+'#'+action+'%22'%0A        %7D%0A    %7D;%0A%0A    var self = this;%0A    if (options !== undefined) %7B%0A        self.callback = options%5B'callback'%5D;%0A    %7D else %7B%0A        self.callback = function(data) %7B console.log(data); %7D;%0A    %7D%0A%0A    var req = http.request(postRequest, function(res) %7B%0A        res.setEncoding('utf8');%0A        res.on('data', self.callback);%0A    %7D);%0A%0A    req.on('error', function(e) %7B%0A        console.log('Error' + e);%0A        return false;%0A    %7D);%0A%0A    req.write(body);%0A    req.end();%0A%7D;%0A

Add sendRequest function