Changeset 277
- Timestamp:
- 06/22/15 23:43:14 (9 years ago)
- Location:
- etherws/trunk
- Files:
-
- 2 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 -
etherws/trunk/setup.py
r276 r277 49 49 install_requires=[ 50 50 'python-pytun>=2.1', 51 'websocket-client>=0.1 2.0',51 'websocket-client>=0.14.0', 52 52 'tornado>=2.4', 53 53 ],
Note: See TracChangeset
for help on using the changeset viewer.