Closed emretulek closed 11 months ago
@emretulek can you maybe provide code to replicate your issue?
I am adding some standard browser headers. Let me also point out that I am using a proxy.
I had no problems when I didn't use tlsClientLibrary.freeMemory(responseObject.id).
const requestPayloadDefault = {
"tlsClientIdentifier": "chrome_105",
"followRedirects": false,
"insecureSkipVerify": false,
"withoutCookieJar": false,
"withDefaultCookieJar": false,
"isByteRequest": false,
"catchPanics": false,
"additionalDecode": null,
"withDebug": false,
"forceHttp1": false,
"withRandomTLSExtensionOrder": true,
"timeoutSeconds": 30,
"timeoutMilliseconds": 0,
"sessionId": "my-session-id",
"proxyUrl": "",
"isRotatingProxy": false,
"certificatePinningHosts": {},
"headers": {},
"headerOrder": [
"accept",
"user-agent",
"accept-encoding",
"accept-language"
],
"requestUrl": "",
"requestMethod": "GET",
"requestBody": "",
"requestCookies": []
}
requestPayload.requestUrl = url;
requestPayload.requestMethod = "GET";
requestPayload.proxyUrl = 'http://' + options.proxy.host + ':' + options.proxy.port;
requestPayload.headers = {
//some headers
}
return await new Promise((resolve, reject) => {
tlsClientLibrary.request.async(JSON.stringify(requestPayload), (err, response) => {
resolve(JSON.parse(response))
});
}).then((response) => {
return response;
});
Although not very often, I see the following errors in my logs, let me state that I am using a proxy again.
failed to do request: Post "https://xxxxxxxx.xxx": unexpected EOF failed to do request: Post "https://xxxxxxxx.xxx": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
@emretulek please take a look at: https://github.com/bogdanfinn/tls-client/issues/53#issuecomment-1594838052
Closed due to inactivity
I get a crash error when I make too many synchronous requests with nodejs. When I send requests at 100ms intervals, it gives an error after a short while.