rework ip publishing and fix a port bug