mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Merge pull request #271 from LostRuins/united
Adding CORS support to allow cross origin requests.
This commit is contained in:
@@ -563,12 +563,14 @@ from flask_socketio import SocketIO, emit, join_room, leave_room
|
||||
from flask_socketio import emit as _emit
|
||||
from flask_session import Session
|
||||
from flask_compress import Compress
|
||||
from flask_cors import CORS
|
||||
from werkzeug.exceptions import HTTPException, NotFound, InternalServerError
|
||||
import secrets
|
||||
app = Flask(__name__, root_path=os.getcwd())
|
||||
app.secret_key = secrets.token_hex()
|
||||
app.config['SESSION_TYPE'] = 'filesystem'
|
||||
app.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||
CORS(app)
|
||||
Compress(app)
|
||||
socketio = SocketIO(app, async_method="eventlet", manage_session=False, cors_allowed_origins='*', max_http_buffer_size=10_000_000)
|
||||
#socketio = SocketIO(app, async_method="eventlet", manage_session=False, cors_allowed_origins='*', max_http_buffer_size=10_000_000, logger=logger, engineio_logger=True)
|
||||
|
Reference in New Issue
Block a user