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) { ...@@ -7,7 +7,8 @@ var agi = function (handler, optionsIn) {
var settings = { var settings = {
port: options.port || 3000, port: options.port || 3000,
debug: options.debug || false debug: options.debug || false,
host: options.host,
}; };
var handle = function (stream) { var handle = function (stream) {
...@@ -15,9 +16,10 @@ var agi = function (handler, optionsIn) { ...@@ -15,9 +16,10 @@ var agi = function (handler, optionsIn) {
handler(context); handler(context);
}; };
var start = function (portIn) { var start = function (portIn, hostIn) {
var port = portIn || settings.port; 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 { return {
......
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