diff --git a/lib/server/WebDAVServer.js b/lib/server/WebDAVServer.js index d53533f4..00058d36 100644 --- a/lib/server/WebDAVServer.js +++ b/lib/server/WebDAVServer.js @@ -193,7 +193,7 @@ var WebDAVServer = (function () { } }); }); - this.server.listen(port); + this.server.listen(port, this.options.hostname); }; WebDAVServer.prototype.stop = function (callback) { if (this.server) { diff --git a/lib/server/WebDAVServerOptions.d.ts b/lib/server/WebDAVServerOptions.d.ts index f95e2317..5fa49b7b 100644 --- a/lib/server/WebDAVServerOptions.d.ts +++ b/lib/server/WebDAVServerOptions.d.ts @@ -9,6 +9,7 @@ export declare class WebDAVServerOptions { rootResource?: IResource; userManager?: IUserManager; lockTimeout?: number; + hostname?: string; port?: number; } export default WebDAVServerOptions; diff --git a/lib/server/WebDAVServerOptions.js b/lib/server/WebDAVServerOptions.js index 0947b80c..88ce6ba0 100644 --- a/lib/server/WebDAVServerOptions.js +++ b/lib/server/WebDAVServerOptions.js @@ -12,6 +12,7 @@ var WebDAVServerOptions = (function () { this.rootResource = new RootResource_1.RootResource(); this.userManager = new SimpleUserManager_1.SimpleUserManager(); this.lockTimeout = 3600; + this.hostname = '::'; this.port = 1900; } return WebDAVServerOptions; diff --git a/src/server/WebDAVServer.ts b/src/server/WebDAVServer.ts index c8bc962c..c90d0757 100644 --- a/src/server/WebDAVServer.ts +++ b/src/server/WebDAVServer.ts @@ -279,7 +279,7 @@ export class WebDAVServer } }) }) - this.server.listen(port); + this.server.listen(port, this.options.hostname,); } stop(callback : () => void) diff --git a/src/server/WebDAVServerOptions.ts b/src/server/WebDAVServerOptions.ts index bc809d90..14f90956 100644 --- a/src/server/WebDAVServerOptions.ts +++ b/src/server/WebDAVServerOptions.ts @@ -15,6 +15,7 @@ export class WebDAVServerOptions rootResource ?: IResource = new RootResource() userManager ?: IUserManager = new SimpleUserManager() lockTimeout ?: number = 3600 + hostname ?: string = '::' port ?: number = 1900 } export default WebDAVServerOptions;