Added relay and master server mode