add :main, switch port lookup to envvar