Merge branch 'main' of https://github.com/j93es/oauth-backend into nonce_check

This commit is contained in:
sultanofdisco 2025-06-13 21:37:03 +09:00
commit 79295badd1
3 changed files with 18 additions and 16 deletions

View file

@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

30
main.py
View file

@ -1,21 +1,23 @@
from runner.proxy import run_proxy
import subprocess
import threading
import uvicorn
from runner.backend import app
def run_fastapi_server():
"""FastAPI 서버를 실행하는 함수"""
uvicorn.run(app, host="localhost", port=11081, log_level="info")
if __name__ == "__main__":
# Start web server in a separate thread
server_process = subprocess.Popen([
"granian",
"--interface", "asgi",
"--host", "0.0.0.0",
"--port", "11081",
"--loop", "asyncio",
"--reload",
"runner.backend:app",
])
try:
# Run mitmdump proxy
# FastAPI 서버를 백그라운드 스레드에서 실행
fastapi_thread = threading.Thread(target=run_fastapi_server, daemon=True)
fastapi_thread.start()
print("🚀 FastAPI server started on http://localhost:11081")
# Run mitmdump proxy (메인 스레드에서 실행)
print("🛡️ Starting mitmdump proxy on port 11080...")
run_proxy()
except KeyboardInterrupt:
print("🛑 Shutting down...")
finally:
server_process.terminate()
print("✅ Mitmdump proxy has been stopped.")

View file

@ -20,4 +20,4 @@ async def not_found_handler(request, exc):
@app.exception_handler(405)
async def method_not_allowed_handler(request, exc):
return Response(status_code=405)
return Response(status_code=405)