Spaces:
Runtime error
Runtime error
DJAKOUA KWANKAM BRAYAN STEVE commited on
Commit ·
633e730
1
Parent(s): 7f3c81c
Correction des timeouts DNS sur reseau dual-stack (IPv6)
Browse files
cypher-chat-app/server.js
CHANGED
|
@@ -3,9 +3,13 @@ import cors from "cors";
|
|
| 3 |
import path from "path";
|
| 4 |
import fs from "fs";
|
| 5 |
import https from "https";
|
|
|
|
| 6 |
import { spawn } from "child_process";
|
| 7 |
import { fileURLToPath } from "url";
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
const __filename = fileURLToPath(import.meta.url);
|
| 10 |
const __dirname = path.dirname(__filename);
|
| 11 |
|
|
|
|
| 3 |
import path from "path";
|
| 4 |
import fs from "fs";
|
| 5 |
import https from "https";
|
| 6 |
+
import dns from "dns";
|
| 7 |
import { spawn } from "child_process";
|
| 8 |
import { fileURLToPath } from "url";
|
| 9 |
|
| 10 |
+
// Force Node.js to resolve IPv4 addresses first to avoid ETIMEDOUT bugs on dual-stack networks
|
| 11 |
+
dns.setDefaultResultOrder("ipv4first");
|
| 12 |
+
|
| 13 |
const __filename = fileURLToPath(import.meta.url);
|
| 14 |
const __dirname = path.dirname(__filename);
|
| 15 |
|