Keep_alive Error

This code is function as a Token onliner , used to host token goes online.
Am getting this error while hosting on Reserved VM >>

{'type': 'ConnectionResetError', 'message': '[Errno 104] Connection reset by peer', 'trace': [{'filename': 'main.py', 'name': 'connect', 'lineno': 331}, {'filename': '/home/runner/931f35cd-c54a-4158-9376-eabb0ff095eb/venv/lib/python3.8/site-packages/websocket/_core.py', 'name': 'send', 'lineno': 283}, {'filename': '/home/runner/931f35cd-c54a-4158-9376-eabb0ff095eb/venv/lib/python3.8/site-packages/websocket/_core.py', 'name': 'send_frame', 'lineno': 311}, {'filename': '/home/runner/931f35cd-c54a-4158-9376-eabb0ff095eb/venv/lib/python3.8/site-packages/websocket/_core.py', 'name': '_send', 'lineno': 525}, {'filename': '/home/runner/931f35cd-c54a-4158-9376-eabb0ff095eb/venv/lib/python3.8/site-packages/websocket/_socket.py', 'name': 'send', 'lineno': 170}, {'filename': '/home/runner/931f35cd-c54a-4158-9376-eabb0ff095eb/venv/lib/python3.8/site-packages/websocket/_socket.py', 'name': '_send', 'lineno': 147}, {'filename': '/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/ssl.py', 'name': 'send', 'lineno': 1173}]}

Which causing the token goes offline.

Repl link > https://replit.com/@dtire/1#data/tokens.txt
Screenshot > Untitled-1 hosted at ImgBB — ImgBB

from flask import Flask
from threading import Thread

app = Flask('')

@app.route('/')
def main():
  return "Onliner 1 - Working fine atm"

def run():
  app.run(host="0.0.0.0", port=8000)

def keep_alive():
  server = Thread(target=run)
  server.start()