lazebird.rabbit.http
2.0.0
See the version list below for details.
dotnet add package lazebird.rabbit.http --version 2.0.0
NuGet\Install-Package lazebird.rabbit.http -Version 2.0.0
<PackageReference Include="lazebird.rabbit.http" Version="2.0.0" />
paket add lazebird.rabbit.http --version 2.0.0
#r "nuget: lazebird.rabbit.http, 2.0.0"
// Install lazebird.rabbit.http as a Cake Addin #addin nuget:?package=lazebird.rabbit.http&version=2.0.0 // Install lazebird.rabbit.http as a Cake Tool #tool nuget:?package=lazebird.rabbit.http&version=2.0.0
httpd
Description
Target
API
public httpd(Action<string> log) 构造函数 log:log输出接口
public void init_mime(string value) 初始化MIME映射关系 value:MIME映射字符串,例如:
string mime = "";
mime += ".svg:image/svg+xml;";
mime += ".html:text/html;";
mime += ".htm:text/html;";
mime += ".js:application/x-javascript;";
mime += ".css:text/css;";
mime += ".mp4:video/mpeg4;";
mime += ".mpeg:video/mpg;";
mime += ".avi:video/avi;";
mime += ".mp3:audio/mp3;";
mime += ".mid:audio/mid;";
mime += ".jpg:application/x-jpg;";
mime += ".jpeg:image/jpeg;";
mime += ".img:application/x-img;";
mime += ".ico:image/x-icon;";
mime += ".png:image/png;";
mime += "*:application/octet-stream;";
public bool start(int port) 启动httpd port:http端口号
public void stop() 停止httpd
public void set_root(string path) 设置服务器根目录,默认为空目录
public void add_dir(string path) 添加文件夹到根目录中 path:文件夹路径
public void del_dir(string path) 从根目录中删除文件夹 path:文件夹路径
public void add_file(string path) 从根目录中添加文件 path:文件路径
public void del_file(string path) 从根目录中删除文件 path:文件路径
Sample
httpd httpd = new httpd(httpd_log_func);
httpd.init_mime(myconf.get("mime"));
httpd.set_root(".");
httpd.start(8000);
void httpd_log_func(string msg)
{
console.write(msg);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
support http server, set root dir, add dir, add file