Proper socket server for rrest

This pull request introduces a proper socket server for rrest requests.