Skip to content

Commit

Permalink
Merge branch 'release/0.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDoee committed Mar 28, 2017
2 parents 774b9cd + a66854e commit f4cc232
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
@@ -1,3 +1,8 @@
Version 0.2.2 (28-03-2017)
===========================================================

* Added workaround for Direct SSL problem using proxyheader

Version 0.2.1 (20-03-2017)
===========================================================

Expand Down
2 changes: 1 addition & 1 deletion txasgiresource/__init__.py
Expand Up @@ -3,4 +3,4 @@
except ImportError:
pass

__version__ = '0.2.1'
__version__ = '0.2.2'
7 changes: 6 additions & 1 deletion txasgiresource/asgiresource.py
Expand Up @@ -24,7 +24,8 @@ def __init__(self,
ping_timeout=30,
ws_protocols=None,
start_scheduler=True,
use_proxy_headers=False):
use_proxy_headers=False,
use_proxy_proto_header=False):
self.manager = ChannelLayerManager(channel_layer, start_scheduler=True)
self.root_path = root_path

Expand All @@ -34,6 +35,7 @@ def __init__(self,
self.ping_timeout = ping_timeout
self.ws_protocols = ws_protocols
self.use_proxy_headers = use_proxy_headers
self.use_proxy_proto_header = use_proxy_proto_header

resource.Resource.__init__(self)

Expand Down Expand Up @@ -99,6 +101,9 @@ def render(self, request):

client_info = [proxy_forwarded_host.decode('utf-8'), port]

if self.use_proxy_proto_header:
headers.append([b'x-forwarded-proto', 'http%s' % (request.isSecure() and 's' or '')])

# build base payload used by both websocket and normal as handshake
channel_base_payload = {
'path': path,
Expand Down

0 comments on commit f4cc232

Please sign in to comment.