FileHeron CLI

一个简单的文件服务器

下载

您可以从 Releases 下载最新版本

  • 注意:目前,版本仅适用于 Mac OSX。Windows 和 Linux 版本即将推出。

用法

./fileheron -h localhost -p 8080 -r public -d true -l log.txt -s true -c server_chain.pem -k server_key.pem -u password

./fileheron --host localhost --port 8080 --root public --listDir true --logFile log.txt --ssl true --certificateChain server_chain.pem --serverKey server_key.pem --serverKeyPassword password

如果下载的文件未显示为可执行文件,请按此方式修复权限

chmod 755 ./fileheron

构建

您可以使用 dart2native 或 dart compile(属于 Dart SDK)自行构建服务器。

  • Linux / MacOS

// Using dart2native
dart2native ./bin/main.dart -o ./build/fileheron

// Using dart compile
dart compile exe ./bin/main.dart -o ./build/fileheron
  • Windows

// Using dart2native
dart2native bin\main.dart -o build\fileheron.exe

// Using dart compile
dart compile exe bin\main.dart -o build\fileheron.exe

参数

参数 描述 默认值 可能的值
host (-h) 主机名 localhost 有效地址
port (-p) 端口 8080 有效端口
root (-r) 静态文件夹 public 有效文件夹
listDir (-d) 在控制台中显示每次调用 true, false
logFile (-l) 日志文件 日志文件名
ssl (-s) SSL 模式 true, false
certificateChain (-c) 证书链 有效文件名
serverKey (-k) 服务器密钥 有效文件名
serverKeyPassword (-u) 服务器密钥密码 password

GitHub

查看 Github