Commit 4eb65edf authored by Dmitriev Sergey's avatar Dmitriev Sergey Committed by GitHub

Merge pull request #10 from gdaszuta/master

Allow binding AGI server to specified host
parents fb2531cf 78f5532f
......@@ -7,7 +7,8 @@ var agi = function (handler, optionsIn) {
var settings = {
port: options.port || 3000,
debug: options.debug || false
debug: options.debug || false,
host: options.host,
};
var handle = function (stream) {
......@@ -15,9 +16,10 @@ var agi = function (handler, optionsIn) {
handler(context);
};
var start = function (portIn) {
var start = function (portIn, hostIn) {
var port = portIn || settings.port;
return require('net').createServer(handle).listen(port);
var host = hostIn || settings.host;
return require('net').createServer(handle).listen(port, host);
};
return {
......@@ -25,4 +27,4 @@ var agi = function (handler, optionsIn) {
};
};
module.exports = agi;
\ No newline at end of file
module.exports = agi;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment