風雲 (ID: 3)
头衔:论坛版主
等级:大天使
积分:1567
发帖:70 篇
来自:保密
注册:2022/3/30 15:28:53
造访:2024/11/22 10:43:44
发帖:70 篇
来自:保密
注册:2022/3/30 15:28:53
造访:2024/11/22 10:43:44
[ 第 1 楼 ]
回复
const webdav = require('webdav-server').v2;
const userManager = new webdav.SimpleUserManager;
const user = userManager.addUser('username', 'password', false);
const privilegeManager = new webdav.SimplePathPrivilegeManager;
privilegeManager.setRights(user, '/', [ 'all' ]);
const server = new webdav.WebDAVServer({
httpAuthentication: new webdav.HTTPDigestAuthentication(userManager, 'WebDAV Login'),
privilegeManager: privilegeManager, port: 1900,
rootFileSystem: new webdav.PhysicalFileSystem('.')
});
server.start(() => console.log('READY at 1900 port'));
2024/3/12 20:04:07
IP:已设置保密