socket-function 0.37.0 → 0.38.0
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/https.ts +3 -1
- package/src/websocketFactory.ts +0 -6
package/package.json
CHANGED
package/src/https.ts
CHANGED
|
@@ -23,13 +23,15 @@ export function httpsRequest(
|
|
|
23
23
|
if (urlObj.port) {
|
|
24
24
|
port = +urlObj.port;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
26
|
return new Promise<Buffer>((resolve, reject) => {
|
|
28
27
|
let httpRequest = requestor.request(
|
|
29
28
|
urlObj + "",
|
|
30
29
|
{
|
|
31
30
|
method,
|
|
32
31
|
headers: config?.headers,
|
|
32
|
+
// NOTE: We get a lot of backblaze errors when we try to re-use connections. It might be faster,
|
|
33
|
+
// but... anything that cares about speed should use websockets anyways...
|
|
34
|
+
agent: new requestor.Agent({ keepAlive: false }),
|
|
33
35
|
},
|
|
34
36
|
async httpResponse => {
|
|
35
37
|
let data: Buffer[] = [];
|
package/src/websocketFactory.ts
CHANGED
|
@@ -38,12 +38,6 @@ export function createWebsocketFactory(): (nodeId: string) => SenderInterface {
|
|
|
38
38
|
}
|
|
39
39
|
let webSocket = new ws.WebSocket(`wss://${address}:${port}`, undefined, {
|
|
40
40
|
ca: getTrustedCertificates(),
|
|
41
|
-
// createConnection(options, oncreate) {
|
|
42
|
-
// // NOTE: If our latency is 500ms, with 10MB/s, then we need a high water
|
|
43
|
-
// // mark of at least 5MB, otherwise our connection is slowed down.
|
|
44
|
-
// //(options as any).writableHighWaterMark = 5 * 1024 * 1024;
|
|
45
|
-
// return tls.connect(options as any, oncreate as any);
|
|
46
|
-
// },
|
|
47
41
|
});
|
|
48
42
|
|
|
49
43
|
// NOTE: Little setup is done here, because Sometimes websockets are created here,
|