Questions tagged [node-https]

53 questions
1
vote
2 answers

How to make HTTP request with promises and retries in Node.js

I am trying to write a few wrappers around Node HTTP/S module requests, without using axios. node-fetch or any other 3rd party module. For example, I want to have functions sendGet, sendPost, sendJSON, sendFile etc. In ideal case, these functions…
1
vote
0 answers

Nodejs HTTPS->HTTPS proxy

I'm trying to setup an HTTPS server that proxies requests to changing targets that also enforce HTTPS. this is because I want to setup an intercepting https proxy, terminate ssl, modify data and send encrypted modifications to target server (or…
toti
  • 43
  • 1
  • 6
1
vote
1 answer

Send POST request with XML data in node.js: Error 400, "The request sent by the client was syntactically incorrect"

I'm trying to reproduce this Python POST request (verified working) with node.js. It is a fairly simple POST request sending and receiving XML data. However, I am getting The request sent by the client was syntactically incorrect errors, despite my…
AF7
  • 3,160
  • 28
  • 63
1
vote
1 answer

Socket Hangup Error In Node JS On Force API Timeout

I am using request module in Node JS (v8.12) to call a third party API. Since the API is not very reliable and due to lack of better option I am timing out the call after 2 seconds in case if there is no response from the API. But in doing so it…
pythoniesta
  • 317
  • 6
  • 19
1
vote
1 answer

Node - Exception thrown when inserting into MongoDB (byte array)

I'm getting the error in my Express + NodeJS app. I'm using an API from CoinAPI.io, and I've had an issue in the past with getting a Byte array as a response from the API. I've looked into the issue and I resolved it in the past with a…
danielschnoll
  • 3,045
  • 5
  • 23
  • 34
1
vote
0 answers

Electron successive network requests too slow

I have an electron app, with a module in which I need to send multiple (5000) successive requests to a restful Endpoint. Testing the successive requests to this Endpoint from the browser window yields response times of 80 ms, but now I need to…
1
vote
2 answers

Node - Making a call to an ExpressJS route, and need to do a GET request to an API in it

I'm making a cryptocurrency dashboard for a project, and I'm completely new to Node and Express. This is what I have currently app.get('/search', function(req,res){ res.writeHead(200, {'Content-Type': 'text/html'}); res.write(req.url); …
danielschnoll
  • 3,045
  • 5
  • 23
  • 34
1
vote
0 answers

How do i add ssl certificate to nodejs application to get authorised access to banking API

I am trying to use SSL secured api which Two Way SSL Authentication. Have already created self signed certificate using keytool -genkey command and created 3 key files (selfsigned.crt , selfsigned.p12, selfsigned.jks) which is shared with API…
user4241989
1
vote
0 answers

NodeJS response.on('data') doesn't fire when I add hook to request emit

I make https request with Node's https.request() and listen to response 'data' event: const req = https.request('https://stackoverflow.com/', res => { res.on('data', (chunk) => { console.log('data'); }) }); req.end(); I works fine.…
Alex Velickiy
  • 541
  • 1
  • 7
  • 22
1
vote
0 answers

Node https.request to Docker API closes before full result is returned

I'm trying to make a Node https.request to a Docker daemon on a remote machine. Everything works fine when connecting to daemons with around 40 containers (running or not running) - or when I limit the request to only return around 40 containers.…
Daniel Setréus
  • 552
  • 4
  • 16
0
votes
1 answer

Can't define an extension method on node's https.ClientRequest

I'm getting an error TS2339: Property 'on' does not exist on type 'ClientRequest'. while I'm defining an extension method: export {}; import {ClientRequest} from 'https'; declare module 'https' { class ClientRequest { loadData():…
vovahost
  • 34,185
  • 17
  • 113
  • 116
0
votes
0 answers

Identify the clients connecting to the https server - node

Currently, i have the below code that prints the client details. But, it is printing multiple times whenever the data comes via secure connection. I need to print it for a new connection. Please help. app.on('secureConnection', function (socket) { …
0
votes
0 answers

Log success/failure client requests trying to connect with Node https server(mTLS connectivity)

I would like to print the clients info that tries to connect with node https server, along with the info whether the connection is success or failure. If failed, need to print the reason. Tried capturing the events like secureConnection. But, it has…
0
votes
3 answers

How to reset forEach() function if statement is matched

const downloadurl = ['url1', 'url2'] const filename = 'run.jar' downloadurl.forEach((urls) => { https.get(urls, (httpsres) => { const path = `${installationdirectory}/${filename}` const filePath = fs.createWriteStream(path); …
0
votes
0 answers

Using dns resolve based custom look up function takes longer for parallel requests

I am running hundreds of parallel HTTP requests for all different domains using node http module. If I understood it correctly, node http module does dns lookup using worker threads and hence number of lookups at a time are limited by libuv threads.…
Mary123
  • 11
  • 4