Documentation additions.

This commit is contained in:
David Botton 2020-12-17 22:30:20 -05:00
parent 7232f73458
commit ea8cf343ba
3 changed files with 46 additions and 2 deletions

View file

@ -47,7 +47,7 @@ Status:
- Connection methods
- Websockets - Done
- AJAX/HTML - to do (In 2021 are there browsers supporting Websockets?)
- AJAX/HTML - to do (In 2021 are there browsers not supporting Websockets?)
- Long Poll - to do (Needed for websites for webcrawlers and firewalls)
- Direct API access to native browser components - to do

View file

@ -111,7 +111,7 @@ lisp and the HTML DOM element."))
(export 'create-child)
(defmethod create-child ((obj clog-obj) html &key (auto-place t))
"Create HTML element as child of OBJ and if AUTO-PLACE place-inside-bottom-of OBJ."
"Create HTML element as child of OBJ and if :AUTO-PLACE place-inside-bottom-of OBJ."
(let ((child (create-with-html (connection-id obj) html)))
(if auto-place
(place-inside-bottom-of obj child)

44
docs/reverse-proxies.md Normal file
View file

@ -0,0 +1,44 @@
(This needs updating)
Q) Is it possible to use a reverse proxies / load balancers with CLOG Apps?
A) CLOG uses websockets which uses an http "upgrade" mechanism which means
the proxy or load balancer must have some knowledge of how to handle websockets. The two most popular Apache and Nginx support it:
For nginx see:
http://nginx.org/en/docs/http/websocket.html
http://nginx.com/blog/websocket-nginx/
For Apache 2.4.5+ see:
http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html
Example of CLOG application as its own domain:
<VirtualHost *:80>
ServerName snake.clog.com
ServerAdmin david@botton.com
ProxyPass /clog ws://127.0.0.1:8080/clog
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ErrorLog ${APACHE_LOG_DIR}/clog.err.log
CustomLog ${APACHE_LOG_DIR}/clog.log common
</VirtualHost>
Example of a CLOG application as a subdirectory on a larger site using Apache:
<VirtualHost *:80>
ServerName clog.com
ServerAlias www.clog.com
ServerAdmin david@botton.com
DocumentRoot /www/clog
ProxyPass /snake http://127.0.0.1:8080
ProxyPassReverse /snake http://www.clog.com:8080
ProxyPass /clog ws://www.clog.com:8080/clog
ProxyPass /js http://www.clog.com:8080/js
ErrorLog ${APACHE_LOG_DIR}/clog.err.log
CustomLog ${APACHE_LOG_DIR}/clog.log common
</VirtualHost>