Or better in this case:

```ruby
if (datastore['SRVHOST'] == "0.0.0.0" or datastore['SRVHOST'] == "::")
	srv_host = Rex::Socket.source_address(rhost)
else
	srv_host = datastore['SRVHOST']
end

service_url = 'http://' + srv_host + ':' + datastore['SRVPORT'].to_s + resource_uri
```