0

Okay so basically, I'm writing a piece of code that heavily depends on speed,

headers = {
            'Authorization': 'Bearer '+jtw,
        }
        conn = http.client.HTTPSConnection("api.minecraftservices.com")
        conn.request("PUT", "/minecraft/profile/name/"+user, headers=headers)
        response = conn.getresponse()
        status_code = response.status
        resp = response.read().decode("utf-8")

I tried http.client, but apparently they don't support proxies, I want similar/same speed, and it needs to support proxies, my question now is.. what should I use?

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 20 '22 at 12:33

1 Answers1

0

http.client does support proxies, see

https://docs.python.org/3/library/http.client.html#http.client.HTTPConnection.set_tunnel

Concerning speed, a proxied HTTP request time is dominated by waiting for network responsens, so the various different overheads in curl, Socket or http.client are irrelevant, they will all have the same speed.

Antonio Ragagnin
  • 2,278
  • 4
  • 24
  • 39
  • I don't quite get what that would look like, like this maybe? conn = http.client.HTTPSConnection(choice(proxies), 80) conn.set_tunnel("api.minecraftservices.com") conn.request("PUT", "/minecraft/profile/name/"+user, headers=headers) – Max Merwijk Apr 20 '22 at 10:17
  • Yes it looks right – Antonio Ragagnin Apr 20 '22 at 10:28