Compare commits

..

No commits in common. "d381c5e113b3129d2de35cb535d2cc1c4101aeae" and "1e7f283e801e52e09e7bdc8e75ac15f6d8bc4031" have entirely different histories.

3 changed files with 22 additions and 17 deletions

View File

@ -1,5 +1,3 @@
import gevent.monkey
gevent.monkey.patch_all()
from time import sleep from time import sleep
import subprocess import subprocess
import os import os
@ -11,8 +9,6 @@ from werkzeug.utils import secure_filename
import json import json
import re import re
from requests import get from requests import get
import redis
# redis part for live update # redis part for live update
redis_client = redis.StrictRedis(host='localhost', port=6379, db=0) redis_client = redis.StrictRedis(host='localhost', port=6379, db=0)
@ -20,13 +16,13 @@ pubsub = redis_client.pubsub()
pubsub.subscribe('console') pubsub.subscribe('console')
def generate_output(): def generate_output():
try:
for message in pubsub.listen(): for message in pubsub.listen():
if message['type'] == 'message': if message['type'] == 'message':
yield f"data: {message['data'].decode()}\n\n" yield f"data: {message['data'].decode()}\n\n"
except redis.exceptions.ConnectionError as e:
print(f"Error connecting to Redis: {e}")
@app.route('/stream')
def stream():
return Response(generate_output(), content_type='text/event-stream')
# end # end
global password global password
@ -146,11 +142,6 @@ class User(UserMixin):
users = [User(1)] users = [User(1)]
@app.route('/stream')
def stream():
return Response(generate_output(), content_type='text/event-stream')
@app.route("/login/", methods=["GET", "POST"]) @app.route("/login/", methods=["GET", "POST"])
def login(): def login():
if request.method == 'POST': if request.method == 'POST':
@ -241,6 +232,21 @@ def discord_post():
@app.route("/dev/") @app.route("/dev/")
def dev2(): def dev2():
with open("/app/MsRewards-Reborn/user_data/proxy.json", "r") as inFile:
j = json.load(inFile)
new_proxy = {"address": "ADDRESS", "port": "PORT", "name":"NAME"}
max_index = 0
for i in range(1, 50):
try :
print(j[str(i)])
except :
print(f"found {i - 1} proxys")
max_index = i
break
j[f"{max_index}"] = new_proxy
print(j)
with open("/app/MsRewards-Reborn/user_data/proxy.json", "w") as outfile:
json.dump(j, outfile)
return(render_template("dev.html")) return(render_template("dev.html"))

View File

@ -20,7 +20,6 @@
const eventSource = new EventSource('/stream'); const eventSource = new EventSource('/stream');
eventSource.onmessage = (event) => { eventSource.onmessage = (event) => {
console.log("etqhbbqetbqedrtqberzegr");
const newOutput = document.createElement('div'); const newOutput = document.createElement('div');
newOutput.textContent = event.data; newOutput.textContent = event.data;
consoleElement.appendChild(newOutput); consoleElement.appendChild(newOutput);

View File

@ -1 +1 @@
v6.6.45 v6.6.44