Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to start web server in MAC OS (Sonoma 14.5) #601

Open
Madhukumars opened this issue Jan 22, 2025 · 0 comments
Open

Not able to start web server in MAC OS (Sonoma 14.5) #601

Madhukumars opened this issue Jan 22, 2025 · 0 comments

Comments

@Madhukumars
Copy link

Madhukumars commented Jan 22, 2025

I have a MAUI app where I'm trying to load a web application in WebView control. I need a web server on a particular path to serve the files which are part of index.html. I am using Embed.IO package to create a web server since it's cross-platform, but I'm facing a "Platform Not supported" exception in MAC. (It works fine in Windows).

Here is how I'm starting the web server

    private WebServer _server;
    public void StartLocalServer(string url, string webAppPath)
    {
        try
        {                            
            _server = new WebServer(x => x
            .WithUrlPrefix(url) 
            .WithMode(HttpListenerMode.EmbedIO))
            .WithStaticFolder("/", webAppPath, true); // Serve files from the webAppPath

            // Run the server
            _server.RunAsync();                
        }
        catch (Exception ex)
        {                
        }
    }

The exception I get in MAC OS is

Image

The MAC OS is Sonoma 14.5 and chip is Apple M1 Pro.

Any help in solving this is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant