Solution by Clément_Stenac
Hi,
This error is caused by a proxy which intercepts localhost connections.
You can try adding the following line at the beginning of your script:
Sys.unsetenv("http_proxy")
If that does not work, it means it's a transparent proxy and you'll have to see with your system administrator to ask about disabling the proxy on localhost.