Node.js 如何配置lite服务器以绑定特定接口

Node.js 如何配置lite服务器以绑定特定接口,node.js,lite-server,Node.js,Lite Server,我需要lite服务器只监听localhost。在使用npm运行Angular 2应用程序时,如何配置此功能 我尝试向package.json添加一个选项: [1] > lite-server -b localhost [1] [1] ** browser-sync config ** [1] { injectChanges: false, [1] files: [ './**/*.{html,htm,css,js}' ], [1] watchOptions: { ignored:

我需要lite服务器只监听localhost。在使用npm运行Angular 2应用程序时,如何配置此功能

我尝试向package.json添加一个选项:

[1] > lite-server -b localhost
[1] 
[1] ** browser-sync config **
[1] { injectChanges: false,
[1]   files: [ './**/*.{html,htm,css,js}' ],
[1]   watchOptions: { ignored: 'node_modules' },
[1]   server: { baseDir: './', middleware: [ [Function], [Function] ] },
[1]   port: 56618 }
我尝试将“bind”选项添加到bs-config.json:

[1] > lite-server
[1] 
[1] ** browser-sync config **
[1] { injectChanges: false,
[1]   files: [ './**/*.{html,htm,css,js}' ],
[1]   watchOptions: { ignored: 'node_modules' },
[1]   server: { baseDir: './', middleware: [ [Function], [Function] ] },
[1]   port: 56618,
[1]   bind: 'localhost' }
在这两种情况下,端口在所有接口上都可用。有什么提示吗