All Projects → dajuric → simple-http

dajuric / simple-http

Licence: other
Simple, portable HTTP server for .NET based on HttpListener.

Programming Languages

C#
18002 projects
powershell
5483 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to simple-http

web-benchmarks
A set of HTTP server benchmarks for Golang, node.js and Python with proper CPU utilization and database connection pooling.
Stars: ✭ 22 (-70.27%)
Mutual labels:  http-server
http-node-api
O objetivo dessa aplicação era criar uma API sem nenhuma dependência externa, apenas utilizando as bibliotecas nativas do NodeJS. Tudo foi feito utilizando 100% Javascript.
Stars: ✭ 44 (-40.54%)
Mutual labels:  http-server
Pyro-FileStreamBot
Stream Telegram files to web
Stars: ✭ 38 (-48.65%)
Mutual labels:  http-server
fastglue
Fastglue is an opinionated, bare bones wrapper that glues together fasthttp and fasthttprouter to act as a micro HTTP framework.
Stars: ✭ 71 (-4.05%)
Mutual labels:  http-server
LightWebServer
Java web server using NIO, compatible with http1.1 and support simple MVC function.
Stars: ✭ 38 (-48.65%)
Mutual labels:  http-server
finch-server
Some base classes and configuration used for making a server using finch
Stars: ✭ 23 (-68.92%)
Mutual labels:  http-server
snunit
Scala Native HTTP server based on NGINX Unit
Stars: ✭ 87 (+17.57%)
Mutual labels:  http-server
http-server-online
Start a local HTTP server without any tools, just open a web page.
Stars: ✭ 602 (+713.51%)
Mutual labels:  http-server
stirfry
StirFry is a self contained and lightweight web framework for nodejs
Stars: ✭ 24 (-67.57%)
Mutual labels:  http-server
tracetrout
A magical reverse traceroute HTTP(S) server
Stars: ✭ 48 (-35.14%)
Mutual labels:  http-server
routy
Routy is a lightweight high performance HTTP request router for Racket
Stars: ✭ 20 (-72.97%)
Mutual labels:  http-server
HTTP-Reverse-Shell
An HTTP Reverse Shell in Python
Stars: ✭ 48 (-35.14%)
Mutual labels:  http-server
PuppyProxy
A simple HTTP proxy in C# including support for HTTP CONNECT tunneling
Stars: ✭ 37 (-50%)
Mutual labels:  http-server
vscode-open-in-default-browser
Open In Default Browser
Stars: ✭ 22 (-70.27%)
Mutual labels:  http-server
ComplexHTTPServer
ComplexHTTPServer - A Multithreaded Python SimpleHTTPServer
Stars: ✭ 37 (-50%)
Mutual labels:  http-server
SQLiteQueryServer
Bulk query SQLite database over the network
Stars: ✭ 48 (-35.14%)
Mutual labels:  http-server
gowebview
tool to build android apps with WebView from your golang http server; moved to gitlab.com/microo8/gowebview
Stars: ✭ 35 (-52.7%)
Mutual labels:  http-server
blog
✍️无他术,唯勤读书而多为之,自工。
Stars: ✭ 62 (-16.22%)
Mutual labels:  http-server
v4l2web
V4L2 web interface
Stars: ✭ 20 (-72.97%)
Mutual labels:  http-server
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (-70.27%)
Mutual labels:  http-server

SimpleHTTP logo

NuGet packages version

SimpleHTTP - HTTP server for .NET
Lightweight HTTP server for .NET written based on System.Net.HttpListener. Supports partial file streaming, file caching (ETag), simple templating, single-pass form parsing (no temp file).

Tutorial: CodeProject article

Why SimpleHTTP ?

  • Lightweight
    No dependencies.

  • Simple
    There is only one relevant method Route.Add which associates a route with an action. Other methods are extensions on HttpListenerRequest and HttpListenerResponse classes. Zero configuration.

Sample

The snippets below demonstrate the most common functionality. For a demonstration of the all functionalities check the sample.

//rq - request, rp -response, args - arguments
//Route.Add(...) serves "GET" requests by default

//1) serve file (supports video streaming)
Route.Add("/{file}", (rq, rp, args) => rp.AsFile(rq, args["file"]));

//2) return text with a cookie if a path matches a condition
Route.Add((rq, args)     => rq.Url.LocalPath.ToLower().EndsWith("helloworld"), 
          (rq, rp, args) => rp.WithCookie("myCookie", "myContent")
                              .AsText("Hello world!"));

//3) parse body (fields and files)
Route.Add("/myForm/", (rq, rp, args) => 
{
    var files = rq.ParseBody(args);

    //save files
    foreach (var f in files.Values)
       f.Save(f.FileName);

    //write form-fields
    foreach (var a in args)
       Console.WriteLine(a.Key + " " + a.Value);
       
    rp.AsText(String.Empty);
}, 
"POST");

//run the server
Server.ListenAsync(8000, CancellationToken.None, Route.OnHttpRequestAsync)
      .Wait();

Related Libraries

WebSocketRPC library

How to Engage, Contribute and Provide Feedback

Remember: Your opinion is important and will define the future roadmap.

  • questions, comments - Github
  • spread the word

Final word

If you like the project please star it in order to help to spread the word. That way you will make the framework more significant and in the same time you will motivate me to improve it, so the benefit is mutual.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].