Changeset 277 for etherws/trunk/etherws.py
- Timestamp:
- 06/22/15 23:43:14 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
etherws/trunk/etherws.py
r276 r277 686 686 687 687 self._sslopt = kwargs.get('sslopt', {}) 688 self._options = {}688 self._options = self._getproxy() 689 689 690 690 cred = kwargs.get('cred', None) … … 718 718 raise websocket.WebSocketException('Closed socket') 719 719 return self.device.recv() 720 721 def _getproxy(self): 722 scheme, remain = urllib2.splittype(self.target) 723 724 proxy = urllib2.getproxies().get(scheme.replace('ws', 'http')) 725 if not proxy: 726 return {} 727 728 host = urllib2.splitport(urllib2.splithost(remain)[0])[0] 729 if urllib2.proxy_bypass(host): 730 return {} 731 732 hostport = urllib2.splithost(urllib2.splittype(proxy)[1])[0] 733 host, port = urllib2.splitport(hostport) 734 port = int(port) if port else 0 735 return {'http_proxy_host': host, 'http_proxy_port': port} 720 736 721 737
Note: See TracChangeset
for help on using the changeset viewer.