scottoffen / grapevine

Fast, unopinionated, embeddable, minimalist web framework for .NET
https://scottoffen.github.io/grapevine/
MIT License
103 stars 16 forks source link

Replace HttpListener for .NET 6.0+ #142

Open pgrawehr opened 1 year ago

pgrawehr commented 1 year ago

This replaces the legacy System.Net.HttpListener with SpaceWizzards.HttpListener.HttpListener for .NET 6.0 and above. This replacement implementation is fully managed and does not use any poorly maintained Windows IIS components under the hood. It also no longer requires admin rights (or complex netsh rules) to create the listener and "just works". The only probable downside I can think of is that the network port cannot be shared directly with this implementation, but when something as lightweight as Grapevine is used, that's probably not intended anyway.

Also includes some fixes for ContentType, the old implementation for the default list wasn't working. This resulted in html files being delivered as binary, which then were downloaded by the browser as files instead of displayed as content.

scottoffen commented 1 year ago

I like this idea, but I'm unfamiliar with the package. I'll look into this and get back.

pgrawehr commented 1 year ago

I like this idea, but I'm unfamiliar with the package. I'll look into this and get back.

I didn't know it, either. But it appears to be working and (despite it's low version number) has quite a large number of downloads already.

Hyrius commented 1 year ago

Space Wizards are the developers of the Space Station 14 game. I use a fork of another project maintained by them.

Hyrius commented 1 year ago

I couldn't get HTTPS to work with SpaceWizzards.HttpListener.HttpListener.