?
Solved

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

Posted on 2014-07-21
1
Medium Priority
?
927 Views
Last Modified: 2014-07-22
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
0
Comment
Question by:Honeymoon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Honeymoon earned 0 total points
ID: 40211025
Hi all

I have found the solution myself...
As basadress (Start-Parameter) I had: "http://127.0.0.1:2345/"
I have changed this to: "http://*:2345/"
Now I can access the service on my own machine over my machine-IP-Address and also from another client over the LAN.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question