1 Star 0 Fork 110

HeViking/w5

forked from W5 TEAM/w5 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run.py 2.37 KB
一键复制 编辑 原始数据 按行查看 历史
sanjinhub 提交于 2021-11-28 16:33 . v0.5.0
#!/usr/bin/env python
# encoding:utf-8
import gevent.monkey
gevent.monkey.patch_all()
import sys
import platform
def w5_info(**kwargs):
print(" ##@&$||;..!||||||||||;;||||||||%$@##@")
print(" #@$%||||!` .;|||||;. `:!||||||$@@@")
print(" @$%||||||||!` `!||||$@&")
print(" &$||||||||||!. :|||||%$$")
print(" $%||||||||||` `!||||||$$")
print(" $%|||||||||;. :|||||$$")
print(" $%||||||||!. .;|||$$")
print(" &$||||||||; .!|:. `!%$$")
print(" @$%||||||||;. .:|||!' .!&&")
print(" #@$|||||||||||||||!` '%@@")
print(" ##@$%|||||||||||!` :%@#@")
print(" ###@&$||||||||!` !&###@")
print(" #####@&&%||||:. `%&#####@")
print(" ########&&&%: W5 SOAR '$&@#######@ v{version}".format(version="0.5.0"))
print("=============================================")
print("* Web : https://w5.io")
print("* Github : https://github.com/w5hub/w5")
print("=============================================")
if platform.system() == 'Windows':
print("* Running on http://{host}:{port}/ (Press CTRL+C to quit)".format(host=kwargs["host"],
port=kwargs["port"]))
def start_w5(**kwargs):
w5_info(host=kwargs["host"], port=kwargs["port"])
if platform.system() == 'Windows':
from core import start
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
server = pywsgi.WSGIServer((kwargs["host"], kwargs["port"]), start, handler_class=WebSocketHandler)
server.serve_forever()
else:
import multiprocessing
from gunicorn.app.wsgiapp import run as start_http
workers = multiprocessing.cpu_count() * 2 + 1
sys.argv.append("-k")
sys.argv.append("flask_sockets.Worker")
sys.argv.append("-b")
sys.argv.append(kwargs["host"] + ":" + str(kwargs["port"]))
sys.argv.append("-w")
sys.argv.append(str(workers))
sys.argv.append("-t")
sys.argv.append("60")
sys.argv.append("--threads")
sys.argv.append("2")
sys.argv.append("core:start")
start_http()
if __name__ == '__main__':
host = '0.0.0.0'
port = 8888
start_w5(host=host, port=port)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/heviking/w5.git
git@gitee.com:heviking/w5.git
heviking
w5
w5
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385