Skip to content
libevent2-based HTTP server for C#
C#
Latest commit 22832f5 Mar 30, 2016 @kekekeks Merge pull request #20 from VoX/master
Make headers better conform to OWIN specification
Failed to load latest commit information.
EvHttpSharp.OwinHost Headers better conform to OWIN specification 'Keys MUST be compared u… Mar 29, 2016
EvHttpSharp add statics Mar 9, 2015
Nancy.Hosting.Event2 Updated Nancy to v1.2 Apr 24, 2015
Sandbox Revert "Optionally use custom thread pool. Mono's ThreadPool is slow,… Jan 31, 2015
Tests Implemented multiworker mode Apr 10, 2014
packages
.editorconfig Changed indentation style to common one (spaces) since TabSanity does… Apr 8, 2014
.gitignore Imported code from Nancy.Hosting.Event2 and moved evhttp-related code… Oct 10, 2013
EvHttpSharp.DotSettings Imported code from Nancy.Hosting.Event2 and moved evhttp-related code… Oct 10, 2013
EvHttpSharp.sln Added OWIN host Nov 17, 2014
EvHttpSharp.sln.DotSettings dotTrace is awesome Apr 11, 2014
LICENSE Changed license to Apache-2 Apr 10, 2014
README.md typo in apt-get install command Sep 29, 2014

README.md

evhttp-sharp

libevent2-based HTTP server for C# with host for NancyFx

How to use

At first, optionally call LibLocator.Init("path-to-your-dll-directory"), if you don't do that, it will use default system search order.

To use NancyFx host: new Nancy.Hosting.Event2.NancyEvent2Host("127.0.0.1", 8081), new DefaultNancyBootstrapper()).Start();

EventHttpListener example:

    new EventHttpListener(req => 
    {
        req.Respond (HttpStatusCode.OK, new Dictionary<string, string> { {"Content-Type", "text/plain" }}, Encoding.UTF8.GetBytes("Hello world"));
    }).Start("127.0.0.1", (ushort) 8081); 

Native binaries

Windows

Precompiled binaries are in this repository, Visual Studio should copy them to build target location.

Linux

It needs libevent_core, libevent_extra, libevent_pthreads installed in your system (or just use LibLocator.Init with path to binaries). In Debian-based distros you can install them using apt-get install libevent-core-2.0-5 libevent-extra-2.0-5 libevent-pthreads-2.0-5

Something went wrong with that request. Please try again.