Differences between revisions 4 and 5
Revision 4 as of 2013-03-07 08:26:29
Size: 2308
Editor: PieterSmit
Comment:
Revision 5 as of 2016-01-08 22:39:32
Size: 649
Editor: VerleneSto
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
##master-page:HomepageReadWritePageTemplate
##master-date:Unknown-Date
#format wiki
#language en
= 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
    1. {{{ Exception: ('PythonOption mod_pywebsocket.handler_root is not defined', 3) }}}
    1. {{{ 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>
}}}

 * To test
   1. copy file '''echo_wsh.py''' into /var/www/ws
   2. open webpage to test '''file:///usr/share/doc/python-mod-pywebsocket/examples/console.html''' in browser
   3. test by entering in webpage abe the url '''ws://localhost/ws/echo'''
   4. on web page in display window you should see message '''Connect ws://localhost/ws/echo'''


 * Another problem was with /var/www/ws/websockify_wsh.py
   * Found in Apache2 log '''websockify: ws_protocol = 'binary' (['binary', 'base64'])'''
   * It was picking binary for socket and noVNC only supports base64.
     * Solution, just before it picked the first option, i check for base64 and rather select it.
 
 * Another problem, connecting with vnc.html, found in apache2 log.
   {{{mod_pywebsocket: websockify: connection denied: 'NoneType' object has no attribute 'split'}}}

...
----
CategoryDevelopement
[[HTML(<iframe src="http://www.veoh.com/static/swf/veoh/SPL.swf?videoAutoPlay=0&permalinkId=v20588271KeZwtxGq" width="510" height="510"></iframe>)]]Oliver Howard is what my wife loves to call me but it is not the most masculine phone. Data processing just what I do in my day job but I plan on changing them. What I really enjoy doing in order to use play baseball but Not able to alternative sleep patterns make it my profession really. Louisiana has been my the house. You can find my website here: http://www.urlblogdirectory.com/articles/7970-daily-life-improvements-that-have-been-experienced-after-practicing-self-awareness-exercises-every-

HTML(<iframe src="http://www.veoh.com/static/swf/veoh/SPL.swf?videoAutoPlay=0&permalinkId=v20588271KeZwtxGq" width="510" height="510"></iframe>)Oliver Howard is what my wife loves to call me but it is not the most masculine phone. Data processing just what I do in my day job but I plan on changing them. What I really enjoy doing in order to use play baseball but Not able to alternative sleep patterns make it my profession really. Louisiana has been my the house. You can find my website here: http://www.urlblogdirectory.com/articles/7970-daily-life-improvements-that-have-been-experienced-after-practicing-self-awareness-exercises-every-

PyWebSocket (last edited 2016-01-12 07:21:41 by PieterSmit)