nrepl

2024-06-28T11:59:50.217289Z

We're running a Clojure project with Google's CloudRun, which only allows http traffic. I was hoping to finagle an nREPL-connection via https. I see there are a couple of projects that probably did work at some point (drawbridge, catapult), but if there are people out there happily using those, I haven't been able to find them with my Google-fu. Does anyone in here use nREPL via http? Or tried to and gave up? Or know somewhere I can look? Cheers!

bozhidar 2024-06-28T14:00:35.062799Z

@magnars I'm guessing there's at least one https://blog.jakubholy.net/nrepl-over-http-with-drwabridge-in-2020/ ๐Ÿ™‚

2024-06-28T15:27:02.779119Z

I found that one, but it stopped working a couple leiningens ago. I think maybe the best way forward is a local proxy from socket to http, in an effort to also get CIDER on board.

Ivar Refsdal 2024-06-29T12:48:33.887509Z

I've done some work towards this: https://github.com/ivarref/yasp https://github.com/ivarref/yasp-client https://github.com/ivarref/locksmith (for generating mTLS server and client certs) yasp/yasp-client can also do (optional) mTLS termination It's not exactly polished, not finished, I'm on vacation, busy with 2 small children, etc., BUT I would be happy to help you if time allows. Example client configuration, which is what you would run at your computer:

:stage-repl       {:deps      {com.github.ivarref/yasp-client {:git/sha "2498d1c3889d3642b23fad961244557e9c8207c8"}}
                                :jvm-opts  ["-Dclojure.main.report=stderr"]
                                :exec-fn   com.github.ivarref.yasp-client/start-server!
                                :exec-args {:endpoint    "" ; endpoint handled by yasp on the remote server
                                            :local-port  7777
                                            :remote-host "localhost"
                                            :remote-port 9999
                                            :tls-file    "stage-authenticator-client.keys"}}
if the remote server listens to 127.0.0.1:9999 for nREPL you should be good to go... (and maybe drop tls-file when trying this out first in the start)

Ivar Refsdal 2024-06-29T12:51:03.797479Z

yasp and yasp-client has worked well for me/us here, though the documentation is certainly lacking...

Ivar Refsdal 2024-06-29T12:58:05.582999Z

long time since I viewed this source... There is an example setup for aleph here: https://github.com/ivarref/yasp/tree/main/aleph-example Good luck!

2024-06-29T12:59:11.936969Z

Interesting, thank you, @ivar.refsdal ! ๐Ÿ™

๐Ÿงก 1
๐Ÿ™ 1
bozhidar 2024-07-01T06:35:04.068899Z

@ivar.refsdal Maybe you can add something on the topic in nREPL's docs?

๐Ÿ‘ 1
bozhidar 2024-07-01T06:35:57.407629Z

(when you get to finishing it that is - no rush)

๐Ÿ‘ 1
๐Ÿ˜Ž 1