Fork me on GitHub
#luminus
<
2018-04-23
>
cmal03:04:02

Hi @yogthos, every time I changed a backend clj api function and saved the file, luminus will arrange a lazy reload for the app, so next time I invoke the api from the frontend, there will be >> starting... #'my-app/app (namespace was recompiled)" printed out in the *out*. Can I disable the recompiling on file saves, and only use the cider-repl to send the compiled function? It is confusing when I post a form data to the api, because the csrf always failed after the recompiling is triggered. Thanks.

yogthos05:04:47

@cmal yeah that's just the wrap-reload middleware in the env/dev/clj/<app>/dev_middleware.clj

cmal05:04:42

Thank you!

maukamakai20:04:42

Hello. I am trying to run a luminus app behind an AWS Elastic Load Balancer. The AWS ELB also serves as SSL termination for our services. The error I'm receiving states: Mixed Content: The page at 'https://yoursite:3000/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint '<ws://yourseite:3000/ws>'. This request has been blocked; this endpoint must be available over WSS. I was wondering if anyone could point me to documentation for how I can make luminus serve content correctly behind an AWS ELB? I've read through the official middleware and deployment documentation, but I wasn't able to find anything that fits this use case. Thank you for your time, and I look forward to your response.

sveri20:04:44

@maukamakai I am not sure, but it looks like your websocket connection tries to open a connection to an unsecure port: ws://. If you are using SSL it should be: wss://

maukamakai20:04:30

Thank you @sveri. I do understand that this is the main issue. What I'm having trouble with is the route protocol (ws vs wss) isn't input by me. I believe it's generated by perhaps compojure or has something to do with ring. It's created somewhere in a GET call from compojure. The app itself runs insecure, but it's fronted by an AWS load balancer that terminates SSL connections. So since the app thinks its running insecure, the routes it generates are insecure. I need the app to think its secure and generate secure routes.

maukamakai20:04:52

I've since come across this blog: https://pupeno.com/2015/07/21/forcing-ssl-in-a-luminus-application/ which mentions ring-ssl https://github.com/ring-clojure/ring-ssl I've been playing with getting wrap-forwarded into my routes, but have not had any success yet.

sveri20:04:50

@maukamakai Hm, I see, I am afraid without the code I am of not much more help.

maukamakai20:04:06

Thanks @sveri. The code base is not allowed to be shared. I may try to put together a minimum example that show cases my issue. I'm not sure you'll be able to test without access to a configured AWS ELB though.

maukamakai21:04:10

@sveri you were right the first time. I was getting the client and server mixed up in my head. The URL for ws is defined in my cljs code which doesn't get URLs generated by compojure. Thank you for the insight.