How could I get my script that's using gspread to have the gspread connections to google's servers use a SOCKS proxy?
Asked
Active
Viewed 481 times
1 Answers
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.