HAPoxy Authentication not accessible by curl --proxy-user

I’m configuring a haproxy server to use for my Scrapy scraper. I have configured basic auth in the proxy as such:

userlist basic-auth-list
        group is-admin
        user *username* password *passwd* groups is-admin

backend backend_name
   acl devops-auth http_auth_group(basic-auth-list) is-admin
   http-request auth realm devops unless devops-auth

and am able to send a curl through it by using: curl -x proxy_ip:port -u username:pass url . In my scraper I have tried:

  • headers={‘Proxy-Authorization’: “user:pass encoded with base64”} and
  • headers={“Authentication”:“user:pass encoded with base64”} and also
  • meta={‘proxy’:‘http://username:pass@ip:port’}

and all of them return a 401 Authorization required. I have also noticed that when trying to curl with my haproxy as such: curl -x proxy_ip:port --proxy-user username:pass url or curl -x ‘http://username:pass@proxy_ip:port’ url I also get a 401. The only way it works is by using the -u curl option which is a server authentication. Does anybody know how I can configure haproxy to be accessible through --proxy-user as well?