Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alvagi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
alvagi
Commits
78f5532f
Commit
78f5532f
authored
Apr 18, 2017
by
Grzegorz Daszuta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow binding AGI server to specified host
parent
fb2531cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
index.js
lib/index.js
+6
-4
No files found.
lib/index.js
View file @
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
{
...
@@ -25,4 +27,4 @@ var agi = function (handler, optionsIn) {
...
@@ -25,4 +27,4 @@ var agi = function (handler, optionsIn) {
};
};
};
};
module
.
exports
=
agi
;
module
.
exports
=
agi
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment