Commit 78f5532f authored by Grzegorz Daszuta's avatar Grzegorz Daszuta

Allow binding AGI server to specified host

parent fb2531cf
......@@ -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 {
......
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