You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importfetchfrom"node-fetch";// ...letstatusCode=500;fetch(remoteUrl.toString(),{headers: filterHeaders(req,req.headers),agent: proxy// I do not know whether correct or not to set proxy here}).then((responseStream)=>{statusCode=responseStream.status;res.header(filterHeaders(req,responseStream.headers));returnresponseStream.arrayBuffer();// use `arrayBuffer()` to pipe responseBody in raw bytes format}).then((responseBody)=>{res.status(statusCode).send(responseBody);}).catch((err)=>{// How to handle error?})
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, I am planning to remove the old dependency
request
, since it is deprecated for 2 years, and I prefer to usenode-fetch
to instead of it.There are two things confused me:
proxy
param is? Is it a URL string?Will be:
Thanks!
The text was updated successfully, but these errors were encountered: