mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 22:41:27 +09:00
Merge branch 'main' of https://github.com/j93es/oauth-backend into nonce_check
This commit is contained in:
commit
79295badd1
3 changed files with 18 additions and 16 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v4
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-dependency-glob: "uv.lock"
|
cache-dependency-glob: "uv.lock"
|
||||||
|
|
|
||||||
30
main.py
30
main.py
|
|
@ -1,21 +1,23 @@
|
||||||
from runner.proxy import run_proxy
|
from runner.proxy import run_proxy
|
||||||
import subprocess
|
|
||||||
import threading
|
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__":
|
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:
|
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()
|
run_proxy()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("🛑 Shutting down...")
|
||||||
finally:
|
finally:
|
||||||
server_process.terminate()
|
print("✅ Mitmdump proxy has been stopped.")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue