enerthya.dev-audio-core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/http.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enerthya.dev-audio-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Enerthya Audio Core \u2014 Audio processing engine built from scratch. Resolves and streams audio from YouTube, SoundCloud and direct URLs using native HTTP requests and FFmpeg. No play-dl, no ytdl-core.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"license": "MIT",
|
package/src/utils/http.js
CHANGED
|
@@ -82,8 +82,13 @@ function request(url, opts = {}) {
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
// socket.setTimeout inicia ANTES da conexão TCP ser estabelecida —
|
|
86
|
+
// necessário para capturar IPs bloqueados em nível de firewall.
|
|
87
|
+
// req.setTimeout() só dispara após connect(), não serve para connection timeouts.
|
|
88
|
+
req.on("socket", (socket) => {
|
|
89
|
+
socket.setTimeout(timeout, () => {
|
|
90
|
+
req.destroy(new Error(`Timeout após ${timeout}ms: ${currentUrl}`));
|
|
91
|
+
});
|
|
87
92
|
});
|
|
88
93
|
|
|
89
94
|
req.on("error", reject);
|