title: How to register service in Consul without address declaration
body: <p>Using Consul, I want a service to register itself with the Consul Agent, using the HTTP endpoint <code>/v1/agent/service/register</code>. The only problem is that the service may bind to different IP addresses (1st instance 10.0.0.1, 2nd 10.0.0.2, etc) and I want Consul to set the address automatically basing on the IP address of the request.</p>
  
  <p>For example,</p>
  
  <p>"Service instance 1 (10.0.0.1)" sends <code>{name:'svs', id:'svs-01'}</code> to <code>/v1/agent/service/register</code> and Consul registers it as <code>{name:'svs', id:'svs-01', Address: 10.0.0.1}</code></p>
  
  <p>"Service instance 2 (10.0.0.2)" sends <code>{name:'svs', id:'svs-02'}</code> to <code>/v1/agent/service/register</code> and Consul registers it as <code>{name:'svs', id:'svs-02', Address: 10.0.0.2}</code></p>
  
  <p>According to <a href="https://consul.io/docs/agent/http/agent.html#agent_service_register" rel="nofollow" title="Consul Agent Service Documentation">Consul Agent Service Documentation</a> if the Address field is missing in service register query, the Address will default to that of the agent if not provided. But it is not what I need.</p>
  
  <p>I've tried to detect service's ip address at runtime but it may have several network interfaces and it's hard to distinguish them.</p>