Link to home
Start Free TrialLog in
Avatar of Honeymoon
Honeymoon

asked on

Self Hosted WebApi Accessible ony in Localhost (not over LAN=

Hi all

I have created a self hosted webapi (appBuilder) that runs in a Windows Service.
If I call the api from windows testclient or from fiddler from localhost, it runs fine.
The service runs under my domainaccount .

The service has to be accessible over the LAN:
Therefore  I have called the command:
netsh http add urlacl url=http://+:2345/ user=<domain>\<my domainaccount> delegate=yes
 
Problem:
- After I have called the command, the service is not accessible over my IP and also no more from localhost.
- If I delete the reservation (with netsh delete) the service is accessible again from localhost

Base-Address: http://127.0.0.1:2345/
Code in startup.vb:
Dim config As New HttpConfiguration()
config.MapHttpAttributeRoutes()
config.Routes.MapHttpRoute(name:="DefaultApi", routeTemplate:="api/{controller}/{id}", defaults:=New With {Key .id = RouteParameter.[Optional]})
appBuilder.UseWebApi(config)

Code in OnStart:
  _server = WebApp.Start(Of Startup)(url:=baseAddress)

What do I have to do, to solve this problem?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Honeymoon
Honeymoon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial