mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 05:11:52 +09:00
23 lines
No EOL
822 B
Python
23 lines
No EOL
822 B
Python
from runner.proxy import run_proxy
|
|
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__":
|
|
try:
|
|
# 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:
|
|
print("✅ Mitmdump proxy has been stopped.") |