Giter VIP home page Giter VIP logo

dotnet-freebsd-kestrel's Introduction

dotnet-freebsd-kestrel

Kestrel running on FreeBSD with FileSystemWatcher Hack

This is a workaround a developed in lieu of no FileSystemWatcher class to actually start a web server up in FreeBSD. It is based on the tech blog authored by Sergei Dorogin found here and additionally answers the question of finding hidden files in a Linux or FreeBSD environment.

The main code to look at which instantiates Watcher works like so:

public IChangeToken Watch(string filter)
{
    return _prodider.Watch(filter);
}

I have simply prevented the Watch process from kicking off by using a null object like this:

public IChangeToken ichnge;

public IChangeToken Watch(string filter)
{
    return ichnge;
}

I recommend that this should be the entrance for your custom stub without having to rebuild parts of the whole ecosystem for .Net Core or heh, at least that's what I would do. With this you have the added benefit of being able to run Kestrel on FreeBSD as well.

An IChangeToken therefore can register any custom callbacks.

public IDisposable RegisterChangeCallback (Action<object> callback, object state);

You will know that it's working because an error message will be thrown if it cannot find the static file path- this should be replaced with a file path which actually exists on your system.

FileProvider = new PhysicalFileProviderAdapter("/home/lizardking/Downloads/dotnet-sdk/RunHostCore/home")

You can see that the .csproj file is running netcoreapp30 and this is because I am using a bit of a frakenstein release I threw together myself- the instructions can be found on my post How to build .Net Core on FreeBSD by moving files around

It will need the 2.2 SDK and by using Preview 3 NuGet has been able to download the required dependencies.

Although this is not on the roadmap for 3 right now this code was thrown together in reference of this issue

dotnet-freebsd-kestrel's People

Contributors

wolfspider avatar

Watchers

James Cloos 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.