Brozy123 commited on
Commit
bb26606
·
verified ·
1 Parent(s): 17346ad

Create network_fix.js

Browse files
Files changed (1) hide show
  1. network_fix.js +10 -0
network_fix.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ const https = require('https');
2
+ const http = require('http');
3
+ const dns = require('dns');
4
+ function applyAdvancedFixes() {
5
+ dns.setDefaultResultOrder('ipv4first');
6
+ const options = { family: 4, keepAlive: true, timeout: 30000 };
7
+ https.globalAgent = new https.Agent(options);
8
+ http.globalAgent = new http.Agent(options);
9
+ }
10
+ module.exports = { applyAdvancedFixes };