⇤ ← Revision 1 as of 2013-03-05 19:41:24
1734
Comment: Create notes
|
1810
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
{{{ Exception: ('PythonOption mod_pywebsocket.handler_root is not defined', 3) }}} | 1. {{{ Exception: ('PythonOption mod_pywebsocket.handler_root is not defined', 3) }}} 1. {{{ AttributeError: object has no attribute "APLOG_DEBUG" }}} |
Websockets
- 2013 - New way for javascript to open a tcp connection back to the server for data transfer.
- Here is some notes as I struggled to get the first examples to work.
- Errors in apache log files
Exception: ('PythonOption mod_pywebsocket.handler_root is not defined', 3)
AttributeError: object has no attribute "APLOG_DEBUG"
- Cause was that i had to have the websocket config above the default virtual server in my apache2 config file.
##PES 2013 pywebsocket <IfModule python_module> PythonPath "sys.path+['/mod_pywebsocket']" PythonOption mod_pywebsocket.handler_root /var/www PythonOption mod_pywebsocket.handler_scan /var/www/ws #PythonOption mod_pywebsocket.allow_draft75 On <Location /ws> PythonHeaderParserHandler mod_pywebsocket.headerparserhandler </Location> </IfModule> <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel debug CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
- Errors in apache log files
- To test
copy file echo_wsh.py into /var/www/ws
open webpage to test file:///usr/share/doc/python-mod-pywebsocket/examples/console.html in browser
test by entering in webpage abe the url ws://localhost/ws/echo
on web page in display window you should see message Connect ws://localhost/ws/echo
...