Code Monkey home page Code Monkey logo

Comments (10)

vincentparrett avatar vincentparrett commented on September 28, 2024 1

I renamed the package
VSoft.Extensions.Hosting.Halibut

I would welcome any feedback on this, will probably publish on nuget in the next few days.

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

I have made some progress on this, happy to submit a PR (It depends on my pr #71 ). Still some work to do and testing but it compile ;)

So to configure Halibut with the generic host, you would do this

        static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                .WriteTo.Console()
                .MinimumLevel.Debug()
                .CreateLogger();

            var host = new HostBuilder()
                .UseHalibut((options, services) =>
                {
                    services.RegisterHalibutService<ICalculatorService, CalculatorService>();

                    options.Mode = HalibutServerMode.Listening;
                    options.CertificateFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HalibutServer.pfx");

                    //Listening
                    options.Listen.EndPoint = new IPEndPoint(IPAddress.IPv6Any, 8433);
                    options.Trust.Add("911B7F9E102486C4E1B299FA8D528FE30F129158");
                    //Polling
                    //options.Polling.BaseUri = "https://localhost:8433";
                    //options.Polling.Subscription = "SQ-TENTAPOLL";
                    //options.Polling.RemoteThumbPrint = "ABC.....";
                    //WS Polling
                    //options.Polling.BaseUri = "wss://localhost:8433/Halibut";
                    //options.Polling.Subscription = "SQ-TENTAPOLL";
                    //options.Polling.RemoteThumbPrint = "ABC..";

                    //proxy
                    //options.ProxyDetails = new ProxyDetails("myproxy", 9433, Transport.Proxy.ProxyType.HTTP);
                })
                .UseConsoleLifetime()
                .Build();

            Console.WriteLine("Servier is running, Ctrl+C to stop");
            host.RunAsync();          
        }

Of course in a real application you would do more here, but the halibut config is simple and neat.

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

I have pushed a working version to my fork - comments welcome.

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

I grew impatient (need to get on with migrating from wcf to halibut) so I created a separate project for it, not quite as neat without the ITrustProvider PR but will work all the same. I haven't published a nuget package just yet (will wait to see a response here).

from halibut.

johnsimons avatar johnsimons commented on September 28, 2024

This is awesome

I was also thinking of using the ASP.NET core pipeline to manage the WebSockets, so in essence, remove the transport from Halibut, and that is handled by eg Kestrel ( https://docs.microsoft.com/en-us/aspnet/core/fundamentals/websockets?view=aspnetcore-2.2#how-to-use-websockets )

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

Thanks. I really does keep everything nice and neat and it made it absolutely trivial for us to replace wcf with halibut (I won't miss wcf!). We're using halibut for coms between the build server and the build agents (Continua CI). We're migrating from .net 4.7.2 to .net core 3.0 and I was dreading the wcf change but in the end it turned out to be pretty simple (migrating mvc though is death by a thousand cuts!).

So should I submit a PR for this?

from halibut.

johnsimons avatar johnsimons commented on September 28, 2024

Well given this is a completely new project, is there really a need to include it in this repo?

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

Up to you guys, but it seems like everything is going this way now so it would make sense for it to be part of the halibut repo. It is pretty small, but does need to be a separate nuget package due to it's dependencies differing from halibut (Microsoft.Extensions.Hosting which halibut itself doesn't need).

It really should be named Halibut.Extensions.Hosting but I didn't do that in case you decided to create your own package.

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

Seems like there are two conventions for the package names
https://www.nuget.org/packages?q=Extensions.Hosting

Company.Extensions.Hosting.Product
or
Extensions.Hosting.Product

from halibut.

vincentparrett avatar vincentparrett commented on September 28, 2024

Published to nuget
https://www.nuget.org/packages/VSoft.Extensions.Hosting.Halibut/

I'll close this now since it's done.

from halibut.

Related Issues (20)

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.