Forums

Curl doesn't work on Bash

curl -x https://username:password@us-east-shield-03.quotaguard.com:9294 -L ip.quotaguard.com

Works on Local machine but doesn't work on Bash of Pythonanywhere. We are getting curl: (52) Empty reply from server. And we are getting the following where trying on Webapp.

Max retries exceeded with url: /ip (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))

Please help us resolve this issue.

In the version of curl instlled on PythonAnywhere you need to provide user and password as a separate argument for the -U flag and use only the host address for the -x flag. Cf. curl's help:

-x, --proxy [protocol://]host[:port] Use this proxy
-U, --proxy-user <user:password> Proxy user and password

Regarding the issue in the web app, it doesn't seem to be matching the curl related one, since it's about the /ip url.

curl -x https://us-east-shield-03.quotaguard.com:9294 -u username:password -L ip.quotaguard.com

This isn't working either, getting same error

Then perhaps you can use the -v flag to get more output from curl to see if there are any clues there.

  • Rebuilt URL to: ip.quotaguard.com/
  • Trying 54.165.41.205...
  • Connected to us-east-shield-03.quotaguard.com (54.165.41.205) port 9294 (#0)
  • Server auth using Basic with user 'username'

    GET http://ip.quotaguard.com/ HTTP/1.1 Host: ip.quotaguard.com Authorization: Basic a2N6dmRocWIwN21zNTQ6bmN1bTV4MTM5OHFjZDVqZTU4YTVkMWkydWl3a3g= User-Agent: curl/7.47.0 Accept: / Proxy-Connection: Keep-Alive

  • Empty reply from server
  • Connection #0 to host us-east-shield-03.quotaguard.com left intact curl: (52) Empty reply from server

Getting this now

Meanwhile we are trying to connect proxy server of quotaguard.

Should it be -U instead of -u?