lein-figwheel

kiko 2016-08-18T09:32:49.000143Z

Hi, newbie question. How can I change :websocket-url ? Here's my project.clj, it doesn't reflect the port I specified. https://gist.github.com/kiko/91be403a61c552aa07790f89c8db1d59#file-project-clj-L59

luposlip 2016-08-18T10:21:06.000144Z

@kiko: without being an expert (at all), you need to define the port server side via project.clj (I’ve been using :server-port for this), and then make sure from the client side to connect to this. E.g. using figwheel.client/watch-and-reload. This is where you put the :websocket-url, and optionally a :jsload-callback.

kiko 2016-08-18T13:13:38.000146Z

@luposlip Thanks. Where the figwheel.client/watch-and-reload should be placed at? By the way, https://github.com/bhauman/lein-figwheel#client-side-configuration-options says :websocket-url to be under :cljsbuild, this confuses me. oO

luposlip 2016-08-18T13:17:34.000149Z

@kiko: Perhaps the :websocket-url is being inserted somewhere dynamically by cljsbuild. In my setup I have this in project.clj:

:figwheel {:server-port 3450}
and this in dev/start.cljs which is only compiled in development mode (as configured in project.clj):
(figwheel.client/watch-and-reload
  :websocket-url "<ws://localhost:3450/figwheel-ws>"
  :jsload-callback #(js/console.log "figwheel ready"))

kiko 2016-08-18T13:25:20.000153Z

ohh i found that under env/dev/cljs/<app-name>/dev.cljs ...changing it and finger crossed...

kiko 2016-08-18T13:25:47.000154Z

beautiful, it works! 😄

kiko 2016-08-18T13:26:53.000155Z

Sorry today is my day 1 of cljs. Thanks a lot @luposlip!

luposlip 2016-08-18T13:27:22.000156Z

happy to help @kiko! 🙂