add support for binding at localhost

add localhost binding support.