Configures for port 5001 on remote and fixes socket