lazebird.rabbit.http 2.0.0

.NET Framework 4.6.1
There is a newer version of this package available.
See the version list below for details.
Install-Package lazebird.rabbit.http -Version 2.0.0
dotnet add package lazebird.rabbit.http --version 2.0.0
<PackageReference Include="lazebird.rabbit.http" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add lazebird.rabbit.http --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: lazebird.rabbit.http, 2.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

httpd

Description

Target

API

  1. public httpd(Action<string> log) 构造函数 log:log输出接口

  2. 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;";

  1. public bool start(int port) 启动httpd port:http端口号

  2. public void stop() 停止httpd

  3. public void set_root(string path) 设置服务器根目录,默认为空目录

  4. public void add_dir(string path) 添加文件夹到根目录中 path:文件夹路径

  5. public void del_dir(string path) 从根目录中删除文件夹 path:文件夹路径

  6. public void add_file(string path) 从根目录中添加文件 path:文件路径

  7. 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
.NET Framework net461 net462 net463 net47 net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
3.0.0 430 6/27/2019
2.1.1 545 9/11/2018
2.1.0 591 8/15/2018
2.0.9 572 7/31/2018
2.0.5 589 7/26/2018
2.0.3 586 7/23/2018
2.0.2 675 7/3/2018
2.0.1 659 7/3/2018
2.0.0 573 7/2/2018
1.0.0 686 6/28/2018

support http server, set root dir, add dir, add file