How to make a request from a different IP?

March 15, 2018 481 views
Nginx Ubuntu

I have a droplet running an app that needs to make requests to an external API. I want this droplet to be able to make requests using a different IP.

Someone suggested buying a droplet, turning it off and using its IP. Is that possible? Can someone point me to some resources that explain how to do it? In case it's relevant, I'm using Nginx, Node.js and Ubuntu.

Another naive implementation would be sending a request from the main app to a dummy droplet then have that droplet make the request to the external API.

2 Answers
AdrianStOnge March 16, 2018
Accepted Answer

Unfortunately, that would be considered IP spoofing and isn't really ever needed in normal technical operations.

That being said, it would be possible to send requests to an external API with a different IP address without IP spoofing, by using a VPN or, more likely, a proxy service.

There are many free proxy services which you can google.

There are lots of very cheap VPN services as well. NordVPN is one.
https://nordvpn.com/home-page/

You could also create another droplet in a different location and setup a VPN/proxy on that.

As far as getting your app to run through the proxy or VPN, it would depend on what framework/stack your app uses. I will assume you're using nodejs for sake of argument.

Something like this would allow you to create outgoing requests through a proxy:
http://codingmiles.com/node-js-making-https-request-via-proxy/

There we go, a proxy is what I'm trying to use. And yes, as I mentioned, I use Node.

Thanks!

Have another answer? Share your knowledge.