Fork me on GitHub

Is there a reasonably simple (err.. I might mean easy) way to get a babashka webserver going which is https?

Tomas Brejla15:06:20

Good question. Babashka itself includes HttpKit as a server, which itself suggests using reverse proxy such as Nginx to provide HTTPS support. If you wanted to try to spawn https server yourself manually, then I'm affraid you'd need classes in package (SSLServerSocket, KeyManager, TrustManager and many other) to be present in babashka . They don't seem to be present in babashka. Btw, what's your use case for having such "inlined", totally-standalone https server?


Well, I want to host some html/javascript and I'm lazy. So my first thought was

bb  fileToHost.html
where I can access said file at,
$ open 
I need https because I'm fiddling with CORS and I'm trying to model a problem I'm having at in a larger system.


So I want to have https, and I want to be able to manipulate and set response headers (for the CORS stuff.)


I'd second using a reverse proxy, for your usecase - you can use caddy which can provision a let's encrypt cert for you with one command, no configs needed:


or simply use github pages to upload something?


oh you need local testing, got it


Can also use something like ngrok if you aren't too paranoic with security (since this is for development, should be fine):


Is there a way to generate bindings from a call to "ns-publics" for the options passed to "sci/eval-string"? I tried just passing the result of calling "ns-publics" for the value associated with ":bindings", but it doesn't work. In "sci"'s documentation there's the following example:

(sci/eval-string "(println \"hello\")" {:bindings {'println println}})


@hairfire let's continue in the #sci channel