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

```