svtslv / webdav-cli Goto Github PK
View Code? Open in Web Editor NEWA simple zero-configuration command-line webdav server
A simple zero-configuration command-line webdav server
My Os : Alpine v3.16
My command:
/r npx webdav-cli --host 10.240.4.151 --port 5236 --directory true --autoIndex true --path /root
Response:
· _ _ _ _
__ __ ___ | |__ __| | __ _ __ __ ___ | | (_)
\ \ /\ / / / _ \ | '_ \ / _` | / _` | \ \ / / _____ / __| | | | |
\ V V / | __/ | |_) | | (_| | | (_| | \ V / |_____| | (__ | | | |
\_/\_/ \___| |_.__/ \__,_| \__,_| \_/ \___| |_| |_|
Homepage: https://github.com/svtslv/webdav-cli
Server running at http://10.240.4.151:5236
[rights]: all
[digest]: false
username: zhl8jupfs6l75du7
password: 76kgoerjd72ienb9
Hit CTRL-C to stop the server
Run with --help to print help
Everything was fine. Logged in to the WebDAV server successfully using Chrome browser & rclone.
But when I tried to log in the WebDAV server using Mix Explorer the application crushed.
Here is the log:
>> PROPFIND / > 401 Unauthorized
node:_http_outgoing:576
throw new ERR_HTTP_HEADERS_SENT('set');
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at new NodeError (node:internal/errors:372:5)
at ServerResponse.setHeader (node:_http_outgoing:576:11)
at HTTPRequestContext.writeBody (/root/.npm/_npx/fc0ee8b65271df27/node_modules/webdav-server/lib/server/v2/RequestContext.js:278:31)
at done (/root/.npm/_npx/fc0ee8b65271df27/node_modules/webdav-server/lib/server/v2/commands/Propfind.js:293:25)
at /root/.npm/_npx/fc0ee8b65271df27/node_modules/webdav-server/lib/server/v2/commands/Propfind.js:358:33
at Workflow.doneFn (/root/.npm/_npx/fc0ee8b65271df27/node_modules/webdav-server/lib/server/v2/commands/Propfind.js:350:37)
at /root/.npm/_npx/fc0ee8b65271df27/node_modules/webdav-server/lib/helper/Workflow.js:47:57
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
code: 'ERR_HTTP_HEADERS_SENT'
}
My Configuration Inside Mix Explorer:
Note:I can access other WebDAV server using Mix Explorer without any Issues. So, There is no problem with Mix Explorer WebDAV module
Garbled characters are encountered when the file name is non-ascii characters.
List the files in the current folder.
$ls
baidupcs-batch-upload
http-https-spdy-http2-polyglot
http-test
image-conversion-compression-webp
importcjsamdumd
index.html.1
latest手机就是就是.json
long-image-split-square
node_modules
package-lock.json
package.json
platform-manager-server
rename-by-md5
yarn.lock
Start the webdav service.
npx webdav-cli --digest --ssl --username root --password root --host 0.0.0.0
Open it in the browser to get the following content.
..
.bash_history
.cache
.config
.gitconfig
.node-gyp
.node_repl_history
.npm
.npminstall_tarball
.npmrc
.pnpm-store
.python_history
.wget-hsts
.yarnrc
baidupcs-batch-upload
http-https-spdy-http2-polyglot
http-test
image-conversion-compression-webp
importcjsamdumd
index.html.1
latest鎵嬫満灏辨槸灏辨槸.json
long-image-split-square
node_modules
package-lock.json
package.json
platform-manager-server
rename-by-md5
yarn.lock
webdav-cli/src/webdav-cli.server.ts
Line 83 in e62467a
webdav-cli/src/webdav-cli.server.ts
Line 84 in e62467a
Just make the following changes to the source file to solve the problem.
ctx.response.setHeader('Content-Type', 'text/html;charset=UTF-8');
ctx.response.end(`<html><head></head><body>`+html+`</body></html>`);
This project has a license declared in the README, but not a LICENSE file containing the license terms. I suggest adding it for very clear visibility.
Hi
can authentication be disabled?
npx webdav-cli --username root --password root --host localhost --path d:/ --port 1905
_ _ _ _
__ __ ___ | |__ __| | __ _ __ __ ___ | | (_)
\ \ /\ / / / _ \ | '_ \ / _` | / _` | \ \ / / _____ / __| | | | |
\ V V / | __/ | |_) | | (_| | | (_| | \ V / |_____| | (__ | | | |
\_/\_/ \___| |_.__/ \__,_| \__,_| \_/ \___| |_| |_|
Homepage: https://github.com/svtslv/webdav-cli
Server running at http://localhost:1905
[rights]: all
[digest]: false
username: root
password: root
Hit CTRL-C to stop the server
Run with --help to print help
_http_outgoing.js:543
throw new ERR_HTTP_HEADERS_SENT('set');
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:543:11)
at HTTPRequestContext.writeBody (C:\Users\ma\AppData\Local\Yarn\Data\global\node_modules\webdav-server\lib\server\v2\RequestContext.js:278:31)
at done (C:\Users\ma\AppData\Local\Yarn\Data\global\node_modules\webdav-server\lib\server\v2\commands\Propfind.js:293:25)
at C:\Users\ma\AppData\Local\Yarn\Data\global\node_modules\webdav-server\lib\server\v2\commands\Propfind.js:358:33
at Workflow.err [as errorFn] (C:\Users\ma\AppData\Local\Yarn\Data\global\node_modules\webdav-server\lib\server\v2\commands\Propfind.js:320:33)
at C:\Users\ma\AppData\Local\Yarn\Data\global\node_modules\webdav-server\lib\helper\Workflow.js:35:61
at processTicksAndRejections (internal/process/task_queues.js:75:11) {
code: 'ERR_HTTP_HEADERS_SENT'
}
l use the server in one website, but l got CORS error, can you support the CORS.
You can reference to this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.