Oct-24-2016, 03:01 PM
Hello all.
I have a server which has two IP addresses - primary and secondary.
I have written a python script on server which keeps calling a remote service as HTTP request through "requests" module. By default it uses primary IP of server.
My question is, is there a way to make script use other IP of server for all outbound requests randomly?
Server uses OpenVZ for virtual infrastructure and I can change ip for outbound requests manually via SolusVM control panel but Can I configure script such that it starts using other ip for outbound requests dynamically?
If not, is it possible to setup a proxy server (script running as daemon) on this server which uses this other IP for outbound requests and then I can use this service running on a port as "proxy" in my requests module call?
I have a server which has two IP addresses - primary and secondary.
I have written a python script on server which keeps calling a remote service as HTTP request through "requests" module. By default it uses primary IP of server.
My question is, is there a way to make script use other IP of server for all outbound requests randomly?
Server uses OpenVZ for virtual infrastructure and I can change ip for outbound requests manually via SolusVM control panel but Can I configure script such that it starts using other ip for outbound requests dynamically?
If not, is it possible to setup a proxy server (script running as daemon) on this server which uses this other IP for outbound requests and then I can use this service running on a port as "proxy" in my requests module call?