Spaces:
Running
Running
π§° Multi-Tool Express API Server
API gateway serbaguna berbasis Node.js & Express β mendukung proxy request, fetch & axios passthrough, eval/exec remote, dan YouTube stream downloader (via
yt-dlp
).
π Fitur Utama
- π Universal Proxy:
/proxy
(axios)/fetch
(fetch API)
- π§ͺ Remote Code Execution (for internal debugging only):
/ev
untukeval()
/exec
untuk shell command (exec
)
- π Key-based Access Control untuk endpoint sensitif
- π‘οΈ Built-in rate/debug logger + IP detection (real IP via
x-forwarded-for
) - π¦ Modular: dipisahkan ke beberapa file (
crypto
,prototype
, dll)
π¦ Instalasi
git clone https://github.com/Rifza123/cors.git
cd cors
npm install
βοΈ Konfigurasi
Buat file .env
(opsional) atau atur environment variable:
PORT=7860
PASSWORD=your_secret_key
π§ͺ Contoh Penggunaan
π Proxy (axios):
GET /proxy?url=https://api.example.com
β Fetch Passthrough (streaming/sse supported):
POST /fetch
Body: { "url": "https://example.com/api", "data": { ... } }
π§ Eval:
GET /ev?q=2+2&key=your_secret_key
π₯ Exec (Shell):
GET /exec?q=uptime&key=your_secret_key
π Struktur File
.
βββ index.js # Entry point
βββ lib/
β βββ crypto.js # Enkripsi & dekripsi dengan AES
βββ prototype.js # Prototype tambahan untuk decode string/token
βββ package.json
π‘οΈ Keamanan
β οΈ Endpoint
/ev
dan/exec
menggunakaneval
danchild_process.exec()
β hanya aktif jika password cocok (?key=...
). Jangan expose ke publik tanpa proteksi tambahan seperti IP allowlist atau token OAuth.
π¦ Dependencies
express
,axios
,form-data
yt-search
,yt-dlp
(harus tersedia di sistem)child_process
,util
,crypto
,fs
,path
π§© Tips
- Untuk endpoint YouTube,
yt-dlp
harus terinstall dan tersedia diPATH
. - Kamu bisa integrasi ke bot Telegram, CLI, atau automasi lain.
- Support format
mp3/mp4
via argumentype
.
π License
MIT Β© Rifza