Composer installation proxy settings error

I was trying to install composer but I got this error :
The Composer installer script was not successful [exit code 1].

Your proxy settings may be causing this error.

Script Output:
The “https://getcomposer.org/versions” file could not be downloaded: Failed to open stream: No connection could be made because the target machine actively refused it

I tried to change the proxy ip but it doesn’t work