You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import asyncio
|
|
|
|
import uvicorn
|
|
|
|
import TaskManager
|
|
|
|
import os
|
|
|
|
from web import create_app
|
|
|
|
from hypercorn.asyncio import serve
|
|
|
|
from hypercorn.config import Config
|
|
|
|
|
|
|
|
async def run_quart_app():
|
|
|
|
app = create_app()
|
|
|
|
config = Config()
|
|
|
|
config.bind = ["0.0.0.0:5001"]
|
|
|
|
await serve(app, config)
|
|
|
|
|
|
|
|
#对某个目标进行测试
|
|
|
|
def startWork(targets):
|
|
|
|
TaskM = TaskManager()
|
|
|
|
tlist = targets.split(',')
|
|
|
|
for target in tlist:
|
|
|
|
TaskM.start_task(target)
|
|
|
|
|
|
|
|
|
|
|
|
# Press the green button in the gutter to run the script.
|
|
|
|
if __name__ == '__main__':
|
|
|
|
print(f"Current working directory (run.py): {os.getcwd()}")
|
|
|
|
#启动web项目
|
|
|
|
asyncio.run(run_quart_app())
|
|
|
|
uvicorn.run("run:app", host="0.0.0.0", port=5001, workers=4, reload=True)
|
|
|
|
|