Bind develop to 0.0.0.0

Hello,
I am developing an app using Radzen.
I need to show my work to another person via vpn.
Unfortunately the web page opens on localhost:8000 and I need to open it on myipaddress:8000
How can I bind the radzen web server to 0.0.0.0?
Thanks,
Mario

Indeed applications are bound only to localhost at the moment. We see if we can bind them to 0.0.0.0 by default and release a new version.

Ok so I tried to deploy it.
I deployed to zip.
Put it in a linux machine.
Unzipped the zip archive.
Launched as "dotnet server.dll"
Two problems:

  1. is again bound on localhost
  2. I get blank page and this error:

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
Authorization failed for user: (null).
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
Authorization failed for user: (null).
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3]
Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter'.
info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
Executing ChallengeResult with authentication schemes (Bearer).
info: Microsoft.AspNetCore.Mvc.ChallengeResult[1]
Executing ChallengeResult with authentication schemes (Bearer).
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[12]
AuthenticationScheme: Bearer was challenged.
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[12]
AuthenticationScheme: Bearer was challenged.
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action RicocoNg.Controllers.ApplicationUsersController.GetApplicationUser (server) in 163.7645ms
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action RicocoNg.Controllers.ApplicationUsersController.GetApplicationUser (server) in 163.7645ms
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 805.774ms 401
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 805.774ms 401

tried also http://localhost:5000/appname

Linux deployments of .NET Core applications are usually behind a reverse proxy (nginx, Apache etc). This is why it doesn't run on all ports. You can make it work by adding the Program.cs file to the code generation ignore list and setting the parameter of the UseUrls() method to "http://*:5000".

The log you have pasted doesn't look like an error (there is no exception just informative logging). Is there any exception you see in the output?

Regarding this I have read Microsoft documentation but it seems very strange for me. Infact I already have a reverse proxy for all my sites, in this case I have to add another reverse proxy just to make the dotnet application communicate with official reverse proxy that is on another server.

I supposed the authorization exception user null was an error. The page is blank and stays blank so I cannot ever try to login.
Thanks,
Mario

We will shortly release a new Radzen version which will do tho things:

  1. Production builds will not use UseUrls. By default it would listen to 5000 on 0.0.0.0 with ability to change that from command prompt via the --urls option e.g. dotnet server.dll --urls=http://0.0.0.0:8001
  2. The development build will listen on 0.0.0.0.

Thank you very very much!

Sorry I was misleading: the page gives me a 401 error.

Found the error, if you launch it via dotnet-cli base href must be "/"

1 Like