Connection Refused error

I got the userflag but when trying to run SPOILER REMOVED exploit with python [filename].py , it says [errorno 111] Connection Refused. A small help is aprreciated. Thank you !

Tips to fix-

Restart your device. It might sound simple, but sometimes that’s all it takes to fix a bad connection.
If restarting doesn’t work, switch between Wi-Fi and mobile data: Open your Settings app and tap Network & internet or Connections

Regards,
Rachel Gomez