how to call external api and use proxy
Unanswered
Green-tailed Towhee posted this in #help-forum
Green-tailed TowheeOP
I want to use a proxy to avoid being blocked by the API, as it doesn't support IPs from my location. How can I forward this fetch request through the proxy? agent: proxyAgent throws an error.
14 Replies
@Green-tailed Towhee I want to use a proxy to avoid being blocked by the API, as it doesn't support IPs from my location. How can I forward this fetch request through the proxy? agent: proxyAgent throws an error.
u want fo fetch a api on clientside which is blocked?
in this case u will have a route handler that acts as a middleware between the external api and your client
this way u dont need a proxy at all, u can just change the headers that identify the ipv4 or similar
@gin u want fo fetch a api on clientside which is blocked?
Green-tailed TowheeOP
I have a backend endpoint where, before responding to the client, I call a third-party API to fetch some data. However, my requests are blocked due to the server's location. This is why I need a proxy to simulate a different location
Green-tailed TowheeOP
like so?
@gin
@Green-tailed Towhee Click to see attachment
u will need to send those headers with the fetch yes
u will also probably need to change more headers
u can lookup on the web which ones are used commonly
Green-tailed TowheeOP
tnx
@Green-tailed Towhee tnx
u can mark my answer as solution :)