aaugustin / django-c10k-demo Goto Github PK
View Code? Open in Web Editor NEW10 000 concurrent real-time connections to Django [UNMAINTAINED]
License: BSD 3-Clause "New" or "Revised" License
10 000 concurrent real-time connections to Django [UNMAINTAINED]
License: BSD 3-Clause "New" or "Revised" License
you dont need length detection code
https://github.com/aaugustin/django-c10k-demo/blob/master/c10ktools/servers/tulip.py#L147
tulip code automatically handle length, compression, chunking:
https://code.google.com/p/tulip/source/browse/tulip/http/protocol.py#355
I want use "@websockt" in my Django project, so I add the c10ktools app in my Django project.
but when i visit a webpage which contains non-english charsets. I met a error in server shell. as below:
D:\test\python\django\mysite>python manage.py runserver 192.168.1.100:80
Validating models...
0 errors found
April 12, 2014 - 14:15:30
Django version 1.6.2, using settings 'mysite.settings'
Starting development server at http://192.168.1.100:80/
Quit the server with CTRL-BREAK.
ERROR:root:Error handling request
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\aiohttp\server.py", line 196, in start
yield from handler
File "C:\Python34\lib\site-packages\aiohttp\wsgi.py", line 161, in handle_requ
est
riter = self.wsgi(environ, response.start_response)
File "C:\Python34\lib\site-packages\django\contrib\staticfiles\handlers.py", l
ine 66, in __call__
if not self._should_handle(get_path_info(environ)):
File "C:\Python34\lib\site-packages\django\core\handlers\base.py", line 259, i
n get_path_info
path_info = path_info.encode('iso-8859-1')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 17-20: o
rdinal not in range(256)
I download the c10k demo, and run it as below step.
InvalidHandshake at /watcher/
Invalid request
Request Method: GET
Request URL: http://127.0.0.1:8000/watcher/
Django Version: 1.6.2
Exception Type: InvalidHandshake
Exception Value:
Invalid request
Exception Location: C:\Python34\lib\site-packages\websockets\handshake.py in check_request, line 89
Python Executable: C:\Python34\python.exe
Python Version: 3.4.0
Python Path:
['D:\\test\\python\\django\\django-c10k-demo-master',
'C:\\WINDOWS\\system32\\python34.zip',
'C:\\Python34\\DLLs',
'C:\\Python34\\lib',
'C:\\Python34',
'C:\\Python34\\lib\\site-packages']
Server time: Sat, 5 Apr 2014 13:22:13 +0800
Traceback Switch to copy-and-paste view
C:\Python34\lib\site-packages\django\core\handlers\base.py in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
...
▶ Local vars
D:\test\python\django\django-c10k-demo-master\c10ktools\http\websockets.py in wrapper
return WebSocketResponse(environ, switch_protocols)
...
▶ Local vars
D:\test\python\django\django-c10k-demo-master\c10ktools\http\websockets.py in __init__
key = handshake.check_request(get_header)
...
▶ Local vars
C:\Python34\lib\site-packages\websockets\handshake.py in check_request
raise InvalidHandshake("Invalid request") from exc
...
▶ Local vars
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.