1

I use Owin to self host signalR and my simple html site.

public void Configuration(IAppBuilder app)
    {
        app.UseCors(CorsOptions.AllowAll);
        app.MapSignalR();
        var physicalFileSystem = new PhysicalFileSystem(@"./www");
        var options = new FileServerOptions
        {
            EnableDefaultFiles = true,
            FileSystem = physicalFileSystem
        };
        options.StaticFileOptions.FileSystem = physicalFileSystem;
        options.StaticFileOptions.ServeUnknownFileTypes = true;
        options.DefaultFilesOptions.DefaultFileNames = new[]
        {
            "index.html"
        };
        app.UseFileServer(options);
    }

Everything works fine except I can not access my website via local IP address such as 127.0.0.1. When I navigate localhost:port, it works fine. Note that all both I configure hosting via localhost or wildcard, I get same result.

string baseAddress = "http://*:80/";

My OS is Windows 10. What I tried:

  • Using IP:port, hostname:port urls. All don't work.
  • Disable firewall.
  • Restart my PC.

Hope your helps!

trinvh
  • 1,500
  • 2
  • 11
  • 20

0 Answers0