I’ve got an app which will be running on multiple servers. It exposes a WCF Endpoint. I’d like the endpoint to be available both using loopback and any other IPs the server has (I don’t want to have to configure the IP address of each one, especially since they may potentially change)
The app runs both as windows service and a Console app. I know I can bind to all addresses by using the http://0.0.0.0/<Blah>/ syntax but the links inside wsdl, etc… reference IP address 0.0.0.0 no matter which IP was used when requesting the pages.
Is there any way I can get WCF to use all IPs and respond correctly to them all?
Here’s an example that dynamically binds to all operational IPV4 sockets. Of course you’ll still have to keep track of what address and ports you’re binding to and report them to whatever service is implementing your GetKnownNodes() function. Note that I’m changing the port to avoid a conflict with the loopback address and the external IP. This could be handled differently, of course.