Fork me on GitHub
#shadow-cljs
<
2018-10-30
>
thheller06:10:17

:asset-path "/js" :release {:asset-path "/coolapp/js"}

thheller06:10:32

or :dev {:asset-path ...} whichever you prefer

pekka07:10:30

I have trouble understanding how the :proxy-url works. If I make request to localhost:8888/todos/1 I get HTTP 503

thheller07:10:32

seems correct. I'll check

thheller07:10:29

hmm yeah it doesn't like the https for some reason

pekka07:10:52

There was a different proxy method? Would that work with https? I'd like to develop against a existing API that uses https

thheller07:10:56

there is no other built-in proxy method no but I can fix this issue

pekka07:10:06

oh, great!

thheller07:10:08

its just a config error in the code

thheller07:10:38

@pekka I fixed it locally but now I get a 403 Forbidden from cloudflare

thheller07:10:01

it works when I try to access it directly but not through the proxy

thheller07:10:59

and now it appears to have banned me completely since even the ssl handshake fails

pekka07:10:59

ok 😊

thheller07:10:29

other ssl sites I can proxy fine but cloudfare seems to filter the proxy requests

pekka07:10:59

ok, I don't need cloudflare as such, that was just as an example

pekka07:10:32

Is your fix something you can release though? That would help me very much!

thheller07:10:10

@pekka fixed in version 2.6.20

pekka07:10:22

great! 🙇

pekka08:10:44

now the request works but since the target uses vhost it gets confused 😄

pekka08:10:11

It would work if the proxy rewrites the Origin

pekka08:10:08

Do you know if undertow(?) supports that?

thheller08:10:59

hmm no idea

thheller08:10:18

you can just use any other http server if that is easier

pekka08:10:33

ok, no problem I can live with this 😄

thheller08:10:40

its just files as far as shadow-cljs is concerned

thheller08:10:07

hmm there is a rewriteHostHeader option for the proxy handler

thheller08:10:11

maybe thats enough?

pekka08:10:42

I woud think so

pekka08:10:12

with TLS SNI it is the only thing the webserver sees before terminating TLS

thheller08:10:29

wonder why it defaults to false

thheller08:10:09

guess I'll add an option for that

littleli08:10:42

@thheller yes, I use :asset-path but alone it does not work, assets have to be produced on specified path with specified :output-dir at least and I don't like that location is different for :dev and :release builds 😞

thheller08:10:09

you can override all options

thheller08:10:15

:release {:output-dir "foo/bar"}

littleli08:10:16

sure, it is just that there are more moving parts in the build. like asset 'copying' and so on and on release build process can be different and one has to do additional checking so that build is correct.

thheller08:10:20

not sure I understand what you mean or what the problem is?

littleli08:10:21

it's more or less nitpicking from my side

littleli08:10:51

reproducibility

littleli08:10:11

if there are different pipelines for dev and release, more moving parts, more stuff can break

thheller08:10:44

well dev is always going to have differences compared to release

thheller08:10:03

but I have been running without :release specific config for years

littleli08:10:42

me too, but this project that I have is different unfortunately 🙂

littleli08:10:37

it actually works, so no worries

thheller08:10:22

@pekka just pushed 2.6.21 which fixed a couple issues with the proxy support and also now supports rewriting the host header

thheller08:10:35

enabled by default :proxy-rewrite-host-header false to disable

pekka09:10:44

:thumbsup:

pekka10:10:43

Seems "change origin" would be the feature that is required. for example

thheller10:10:09

what does that do?

pekka10:10:21

change the Origin-header in the request

pekka10:10:50

doesn't seem to be an option on the undertow Proxy...

pekka10:10:27

I can link through the @cedx/reverse-proxy, so no problem for me, just for further study 😊

pekka14:10:35

What are the https settings in :devtools?

pekka14:10:52

or is https supported on devtools http server?

vigilancetech20:10:21

basic "hello world" example for shadow + hoplon + electron (w/reload): https://github.com/vigilancetech-com/shadow-hoplon-electron

thheller21:10:37

what kind of ancient verison is that? 😛

😱 4
thheller22:10:03

@clashthebunny I just checked CLJS master and there were 2 changes to the analyzer/compiler that aren't currently compatible. will need to wait for a final release. can't fix them now since that would break the current 1.10.339 release

ClashTheBunny22:10:28

Great to know. Thanks for being so on top of everything!

thheller22:10:43

seems to work fine with the fixes though. I can push the branch if you are eager to play with master but I think they are getting ready to release "soon" now