Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created June 21, 2013 03:15
Show Gist options
  • Save Unitech/5828562 to your computer and use it in GitHub Desktop.
Save Unitech/5828562 to your computer and use it in GitHub Desktop.
struct
var bind = (function(addr) {
var hostport = String(addr).split(':');
if (hostport.length < 2) {
hostport = [undefined, hostport[0]];
}
if (hostport[0] == null) {
hostport[0] = 'localhost';
}
return {
HOST: hostport[0],
PORT: Number(hostport[1]),
}
})(cst.DAEMON_BIND_ADDR);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment