[server side] Extract discovery to separate class, implement method for getting ip...