0

How could I get my script that's using gspread to have the gspread connections to google's servers use a SOCKS proxy?

GJ.
  • 5,226
  • 13
  • 59
  • 82

1 Answers1

0

SocksiPy should work for this, as per the SO question: How can I use a SOCKS 4/5 proxy with urllib2?.

import socks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 8080)
socket.socket = socks.socksocket

import gspread
# do whatever

If this is not the desired result, you may have to create a custom instance of the bundled HTTPSession object.

Community
  • 1
  • 1
enigma
  • 3,476
  • 2
  • 17
  • 30