How to use CocoaHTTPServer in mobile phones continue to file transfer when the lock screen

How to use CocoaHTTPServer in mobile phones continue to file transfer when the lock screen

I use CocoaHTTPServer built on mobile application server, and then the file transfer to the mobile terminal on MAC, but when my cell phone lock screen, file transfer will fail, I know when the lock screen system closed the connection, but I don’t know what to do. Who can help me?

The pictures from the mobile terminal:

enter image description here

The pictures from the Mac:

enter image description here