rabbibotton / clog

CLOG - The Common Lisp Omnificent GUI
Other
1.47k stars 101 forks source link

Incorporate in existing web server #371

Closed vajrabisj closed 19 hours ago

vajrabisj commented 3 days ago

Is it possible to incorporate clog into existing web server, ie for certain routes to use clog. Thanks.

rabbibotton commented 3 days ago

The answer is yes depending on your server. WEBSERVER.md for how to do with Apache and reverse proxy.

Another way (if not doing a reverse proxy) is to serve all your static html etc from your current webserver including the boot.js file which you modify to a different port to access you CLOG's websocket server. Note: For security the websocket protocol must still be on same domain.

Line 91 in boot.js =

  if (location.port != '') { adr = adr + ':' + location.port; }

You would just change for example the port to 8888

  adr = adr + ':8888';

So your webserver runs with not modifications at all and your clog server use 8888 for ws traffic.

vajrabisj commented 3 days ago

Thanks for your reply. It seems i still cannot get that. I need to setup one of my router, eg example.com:5050/clog to be rendered by clog, and other routers need to still process by webserver which is serving on port 5050. How can i setup CLOG? just changing the ws port as you suggested seems not working...

rabbibotton commented 3 days ago

if has to be same port - 5050 you will need to configure your webserver (unless is also using CLACK) to proxy clog. If can move /clog to 5051 then modifying the boot.js file to use 5051 and serving boot.html from the 5050 server should work no issue.

rabbibotton commented 3 days ago

Feel free to give me details, configs and code to better help

rabbibotton commented 3 days ago

let me know in the end if this works

vajrabisj commented 18 hours ago

Thanks. I changed port in boot.js as you suggested and encountered problem to show the page on /clog route. It seems I did not properly setup the path to the boot.html. There are many arguments in the function clog:initialize, should I modify some of them to use boot.js and serve the boot.html file?

/clog is on 5050, and boot.js port is 8080. Page not shown on server.com:5050/clog, but it is shown on server.com:8080/

Regards,

Michael

David Botton @.***>于2024年6月30日 周日22:47写道:

if has to be same port - 5050 you will need to configure your webserver (unless is also using CLACK) to proxy clog. If can move /clog to 5051 then modifying the boot.js file to use 5051 and serving boot.html from the 5050 server should work no issue.

— Reply to this email directly, view it on GitHub https://github.com/rabbibotton/clog/issues/371#issuecomment-2198586697, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAV3JYH6F4I557N6UUSARLZKALATAVCNFSM6AAAAABKD5NCMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGU4DMNRZG4 . You are receiving this because you authored the thread.Message ID: @.***>