add proxy support to connection (#46)

This commit is contained in:
Jordi Sesmero
2017-11-28 13:23:55 +03:00
committed by Sergey Petrov
parent bbe8528acf
commit a3244df06d
2 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -14,9 +14,10 @@ class Credentials(object):
self.__ssl_context = ssl_context
# Creates a connection with the credentials, if available or necessary.
def create_connection(self, server, port, proto):
def create_connection(self, server, port, proto, proxy_host=None, proxy_port=None):
# self.__ssl_context may be none, and that's fine.
return HTTP20Connection(server, port, ssl_context=self.__ssl_context, force_proto=proto or 'h2')
return HTTP20Connection(server, port, ssl_context=self.__ssl_context, force_proto=proto or 'h2',
proxy_host=proxy_host, proxy_port=proxy_port)
def get_authorization_header(self, topic):
return None