Salamek / huawei-lte-api

API For huawei LAN/WAN LTE Modems
GNU Lesser General Public License v3.0
376 stars 92 forks source link

Is there a way to use proxy with API calls. #97

Closed bashar-ait closed 3 years ago

bashar-ait commented 3 years ago

Hello there,

How can i send an API request through a proxy? just like how we can using requests package.

requests.get(url,proxies=proxies)

Is there a way to do the same with the api?

connection = AuthorizedConnection(f'http://admin:admin@{ip}',proxies=proxy)
client.sms.send_sms(numbers,message)
Salamek commented 3 years ago

@bashar-ait in version 1.5 there is new option to pass custom requests.Session, that should solve your issue, see this howto example code: https://github.com/Salamek/huawei-lte-api/blob/master/examples/connect_with_proxy.py