lazebird.rabbit.http 3.0.0

an stupid http server

Install-Package lazebird.rabbit.http -Version 3.0.0
dotnet add package lazebird.rabbit.http --version 3.0.0
<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.

rhttpd

Description

Target

API

  1. public rhttpd(Action<string> log)

    • Constructor
    • log:Log output interface
  2. 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;";
    
  3. 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
  4. public void stop()

    • Stop rhttpd
  5. public void add_dir(string path)

    • Add a folder to the root directory
    • Path: folder path
  6. public void del_dir(string path)

    • Delete a folder from the root directory
    • Path: folder path
  7. public void add_file(string path)

    • Add files from the root directory
    • Path: file path
  8. 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);
}
```

rhttpd

Description

Target

API

  1. public rhttpd(Action<string> log)

    • Constructor
    • log:Log output interface
  2. 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;";
    
  3. 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
  4. public void stop()

    • Stop rhttpd
  5. public void add_dir(string path)

    • Add a folder to the root directory
    • Path: folder path
  6. public void del_dir(string path)

    • Delete a folder from the root directory
    • Path: folder path
  7. public void add_file(string path)

    • Add files from the root directory
    • Path: file path
  8. 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);
}
```

Release Notes

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

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
3.0.0 59 6/27/2019
2.1.1 154 9/11/2018
2.1.0 151 8/15/2018
2.0.9 166 7/31/2018
2.0.5 175 7/26/2018
2.0.3 166 7/23/2018
2.0.2 222 7/3/2018
2.0.1 192 7/3/2018
2.0.0 174 7/2/2018
1.0.0 217 6/28/2018