near-api-py icon indicating copy to clipboard operation
near-api-py copied to clipboard

JsonProvider should be able to accept proxy arguments

Open 2efPer opened this issue 2 years ago • 0 comments

class JsonProvider(object): def init(self, rpc_addr,proxies=None): ... self.proxies=proxies ... def json_rpc(self, method, params, timeout=2): ... r = requests.post(self.rpc_addr(), json=j, timeout=timeout,proxies=self.proxies) ...

example:

proxies=

{'http':'socks5://localhost:1080','https':'socks5://localhost:1080'}

provider=JsonProvider(node_url,proxies)

2efPer avatar May 15 '22 05:05 2efPer