Giter VIP home page Giter VIP logo

sockethttplistener's Introduction

SocketHttpListener

A standalone HttpListener with support for SSL, WebSockets and Mono

As part of Media Browser Server we needed an http server implementation that could support both WebSockets and Mono together on a single port.

This code was originally forked from websocket-sharp:

https://github.com/sta/websocket-sharp

websocket-sharp was originally a clone of the mono HttpListener found here:

https://github.com/mono/mono/tree/master/mcs/class/System/System.Net

It also added WebSocket support. Over time websocket-sharp began to introduce a lot of refactoring whereas I prefer a straight clone of the mono implementation with added web socket support. So I rebased from the mono version and added web socket support.

In addition, there are a few very minor differences with the mono HttpListener:

  • Added ILogger dependency for application logging
  • Resolved an issue parsing http headers from Upnp devices. (We need to submit a pull request to mono for this).
  • Worked around a known issue with Socket.AcceptAsync and windows (Also need to submit a pull request). See: https://github.com/MediaBrowser/SocketHttpListener/blob/master/SocketHttpListener/Net/EndPointListener.cs#L170
  • I have replaced the BeginGetContext with a simple Action delegate. Unlike the .NET HttpListener this is not hooking into http.sys, therefore the only reason for the internal queue was to match the api. Now the consumer can decide how to handle this.

Available on Nuget

https://www.nuget.org/packages/SocketHttpListener

sockethttplistener's People

Contributors

clancey avatar jabbera avatar lukepulverenti avatar pferraris avatar softworkz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.