Spaces:
Running
Running
File size: 2,244 Bytes
034dfd3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# π§° 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` untuk `eval()`
- `/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
```bash
git clone https://github.com/Rifza123/cors.git
cd cors
npm install
````
---
## βοΈ Konfigurasi
Buat file `.env` (opsional) atau atur environment variable:
```env
PORT=7860
PASSWORD=your_secret_key
```
---
## π§ͺ Contoh Penggunaan
### π Proxy (axios):
```http
GET /proxy?url=https://api.example.com
```
### β Fetch Passthrough (streaming/sse supported):
```http
POST /fetch
Body: { "url": "https://example.com/api", "data": { ... } }
```
### π§ Eval:
```http
GET /ev?q=2+2&key=your_secret_key
```
### π₯ Exec (Shell):
```http
GET /exec?q=uptime&key=your_secret_key
```
---
## π Struktur File
```bash
.
βββ 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` menggunakan `eval` dan `child_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 di `PATH`.
* Kamu bisa integrasi ke bot Telegram, CLI, atau automasi lain.
* Support format `mp3/mp4` via argumen `type`.
---
## π License
[MIT](./LICENSE) Β© Rifza
``` |