Skip to content

Conversation

@LukePulverenti
Copy link

I've added some changes to expose a few classes and members to allow the library to function as a drop-in replacement for the built-in HttpListener. To summarize:

  • Expose HttpUtility publicly (we don't want the System.Web reference required by the framework version).
  • Removed checkDisposed from property getters, making it more consistent with the framework and mono versions
  • Expose ConnectAsServer publicly (we just need the WebSocketContext, without the extra layer on top).
  • Support a custom url prefix
  • Added an OnRequest event that handles any kind of incoming request (including web sockets, and non-standard http methods like SUBSCRIBE, needed for Upnp protocol).

We are just looking for an HttpListener replacement that can support WebSockets on any platform, whereas the framework version requires Windows 8+. With these changes I was able to get up and running very quickly, and everything is running very well. Great work on this library. This if for my project, Media Browser:

https://github.com/MediaBrowser/MediaBrowser

And this is how we're using it:

https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs

We have an abstraction that allows us to switch between your library and the built-in HttpListener easily (if we want). You've got a nice framework here but for our needs we just need an easy replacement. Thanks.

@sta
Copy link
Owner

sta commented Jul 29, 2014

Thank you for pull request.

I've looked at that, so i think i will support Removed checkDisposed from property getters, but others are still pending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants