python3 server.py -h
usage: server.py [-h] [-b BIND] [-d DIRECTORY] [-p {http,webdav}] [--cgi] [--auth AUTH] [port]
Run a simple HTTP or WebDAV server.
positional arguments:
port Port to listen on (default: 8000)
options:
-h, --help show this help message and exit
-b BIND, --bind BIND Address to bind to (default: 0.0.0.0)
-d DIRECTORY, --directory DIRECTORY
Directory to serve (default: current directory)
-p {http,webdav}, --protocol {http,webdav}
Protocol version (default: http)
--cgi Enable CGI
--auth AUTH Authentication credentials (user:pass)
https://gitee.com/shenmo7192/momo-and-mox-tool-scripts/blob/master/server.py
上次更新:
[应用分享] 局域网共享文件的好帮手:python http/webdav server
更新内容
最简单的使用方法: python3 ./server.py
效果:在 8000 端口 开一个 http 服务端
稍微进阶的使用方法:在最简单的方法基础上
如果需要 https 建议套个 nginx 反代
若需要作为上传服务反代,请添加以下nginx参数,分别是延长超时时长,禁用包大小限制和禁用请求缓存