lazebird.rabbit.http
3.0.0
dotnet add package lazebird.rabbit.http --version 3.0.0
NuGet\Install-Package lazebird.rabbit.http -Version 3.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="lazebird.rabbit.http" Version="3.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 3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: lazebird.rabbit.http, 3.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. 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=3.0.0 // Install lazebird.rabbit.http as a Cake Tool #tool nuget:?package=lazebird.rabbit.http&version=3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
rhttpd
Description
Target
API
public rhttpd(Action<string> log)
- Constructor
- log:Log output interface
public 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 void start(int port, Hashtable opts)
- Start rhttpd
- Port: http port number
- opts:
- autoindex: Open the file if there is an index.html or index.htm file under it when opening the directory.
- videoplay: When the video file is opened, the player is enabled by default instead of downloading
public void stop()
- Stop rhttpd
public void add_dir(string path)
- Add a folder to the root directory
- Path: folder path
public void del_dir(string path)
- Delete a folder from the root directory
- Path: folder path
public void add_file(string path)
- Add files from the root directory
- Path: file path
public 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(".");
Hashtable http_opts = ropt.parse_opts(text_httpopt.Text);
rhttpd.start(80, http_opts);
void rhttpd_log_func(string msg)
{
console.write(msg);
}
```
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
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.
support http server, set root dir, add dir, add file