mirror of
https://github.com/django/daphne.git
synced 2024-11-22 07:56:34 +03:00
Change to unicode channel names
This commit is contained in:
parent
f38f2a442e
commit
3ac43cacf0
|
@ -25,7 +25,7 @@ class WebRequest(http.Request):
|
||||||
# Easy factory link
|
# Easy factory link
|
||||||
self.factory = self.channel.factory
|
self.factory = self.channel.factory
|
||||||
# Make a name for our reply channel
|
# Make a name for our reply channel
|
||||||
self.reply_channel = self.factory.channel_layer.new_channel(b"!http.response.?")
|
self.reply_channel = self.factory.channel_layer.new_channel("!http.response.?")
|
||||||
# Tell factory we're that channel's client
|
# Tell factory we're that channel's client
|
||||||
self.last_keepalive = time.time()
|
self.last_keepalive = time.time()
|
||||||
self.factory.reply_protocols[self.reply_channel] = self
|
self.factory.reply_protocols[self.reply_channel] = self
|
||||||
|
@ -66,7 +66,7 @@ class WebRequest(http.Request):
|
||||||
else:
|
else:
|
||||||
# Send request message
|
# Send request message
|
||||||
logging.debug("HTTP %s request for %s", self.method, self.reply_channel)
|
logging.debug("HTTP %s request for %s", self.method, self.reply_channel)
|
||||||
self.factory.channel_layer.send(b"http.request", {
|
self.factory.channel_layer.send("http.request", {
|
||||||
"reply_channel": self.reply_channel,
|
"reply_channel": self.reply_channel,
|
||||||
"method": self.method,
|
"method": self.method,
|
||||||
"get": self.get,
|
"get": self.get,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
||||||
|
|
||||||
from django.http import parse_cookie
|
from django.http import parse_cookie
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user