Question

How to make a request from a different IP?

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.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.