This commit is contained in:
wang 2024-07-11 17:09:01 +08:00
parent d7c77f4c0f
commit 056a1e6537
4 changed files with 7 additions and 4 deletions

View File

@ -21,7 +21,7 @@ export default function Test({ ip = "", port = "22", password = "123456", user =
if (terminal !== null) {
terminal.open(terminalObj.current);
const newSocket = io("ws://");
const newSocket = io("ws://" + window.location.host);
setSocket(newSocket);
terminal.onData((data) => {

View File

@ -29,7 +29,7 @@ services:
ports:
- '8000:8000'
- '8765:8765'
command: gunicorn -w 3 -t 60 -b 0.0.0.0:8000 app:app
command: gunicorn -w 1 -t 60 -b 0.0.0.0:8000 app:app
code-server:
build: ./docker/code-server

View File

@ -39,4 +39,4 @@ COPY --from=build-frontend /usr/src/app/build/ /home/flask/public/
EXPOSE 8000 22 8765
USER root
CMD ["gunicorn", "-w", "3", "-t", "60", "-b", "0.0.0.0:8000", "app:app"]
CMD ["gunicorn", "-w", "1", "-t", "60", "-b", "0.0.0.0:8000", "app:app"]

View File

@ -11,6 +11,9 @@ from student_func import *
from flask import Flask, render_template, request, jsonify, send_from_directory, session
from flask_cors import CORS
from flask_socketio import SocketIO, emit, disconnect
from engineio.payload import Payload
Payload.max_decode_packets = 500
import logging
import os
print(os.getcwd())
@ -23,7 +26,7 @@ cors = CORS(app, resource={
}
})
app.config['SECRET_KEY'] = '350625'
socketio = SocketIO(app, cors_allowed_origins="*")
socketio = SocketIO(app, cors_allowed_origins="*", ping_timeout=1000, ping_interval=0)
clients = {}