lazebird.rabbit.http
2.0.2
See the version list below for details.
dotnet add package lazebird.rabbit.http --version 2.0.2
NuGet\Install-Package lazebird.rabbit.http -Version 2.0.2
<PackageReference Include="lazebird.rabbit.http" Version="2.0.2" />
paket add lazebird.rabbit.http --version 2.0.2
#r "nuget: lazebird.rabbit.http, 2.0.2"
// Install lazebird.rabbit.http as a Cake Addin #addin nuget:?package=lazebird.rabbit.http&version=2.0.2 // Install lazebird.rabbit.http as a Cake Tool #tool nuget:?package=lazebird.rabbit.http&version=2.0.2
rhttpd
Description
Target
API
public rhttpd(Action<string> log)
Constructor log:Log output interfacepublic void init_mime(string value)
Initialize MIME mapping value:MIME mapping string, for example:
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)
Start rhttpd Port: http port numberpublic void stop()
Stop rhttpdpublic void set_root(string path)
Set the server root directory, the default is empty directorypublic void add_dir(string path)
Add a folder to the root directory Path: folder pathpublic void del_dir(string path)
Delete a folder from the root directory Path: folder pathpublic void add_file(string path)
Add files from the root directory Path: file pathpublic void del_file(string path)
Delete files from the root directory Path: file path
Sample
rhttpd rhttpd = new rhttpd(rhttpd_log_func);
rhttpd.init_mime(myconf.get("mime"));
rhttpd.set_root(".");
rhttpd.start(8000);
void rhttpd_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