transfer the relay server code and make it independent.