dajuric / simple-http Goto Github PK
View Code? Open in Web Editor NEWSimple, portable HTTP server for .NET based on HttpListener.
License: Other
Simple, portable HTTP server for .NET based on HttpListener.
License: Other
Hey,
I've noticed that the Method collection is a simple list which is NOT thread safe. Using it in a multithreaded application (==Task.Run) can result in weird behaviour which could potentially destroy the process.
I suggest moving to a collection from System.Collections.Concurrent or using an access lock object and locking it with "lock(object){}". You should pay attention to deadlocks.
Another thing which i noticed is that the Route class is static which isnt optimal. There are 2 reasons which came to my mind:
I hope you find those suggestion helpful
"application/x-www-form-urlencoded;charset=UTF-8" is not treated as post request, simple-http cannot get values.
in RequestExtensions.Form.cs, we only treat ContentType == "application/x-www-form-urlencoded" as a valid post request, maybe we can use IndexOf method to decide?
static bool ParseForm(HttpListenerRequest request, Dictionary<string, string> args)
{
if (request.ContentType != "application/x-www-form-urlencoded")
return false;
I'm using simple-http to serve a few static files from within a game. Everything is working great, so thanks!
I was wondering if there is any type of clean-up that I need to do when shutting down the server? I couldn't find anything about that in the samples or in your code-project article.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.