Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Counterclockwise HTTP REPL

In Eclipse+Counterclockwise, when I want to connect to REPL, the dialog tells me I can use nREPL over HTTP:

Connect to REPL dialog

How to set this up? Is this somehow connected to drawbridge? I haven't been able to make these work together, although lein repl :connect http://my.url/repl worked for me.

For clarity, why this is useful compared to classic REPL: classic REPL works for localhost only. You can bridge it through SSH port tunnelling, but this - REPL over HTTP - is a viable alternative for remote, "live" servers.


Just for completeness, the server side:

  • drawbridge - the HTTP transport - https://github.com/cemerick/drawbridge
  • how to use it - https://devcenter.heroku.com/articles/debugging-clojure
  • example app - https://github.com/technomancy/chortles
like image 393
Martin Janiczek Avatar asked May 16 '13 17:05

Martin Janiczek


1 Answers

I've just installed CCW and tried against https://github.com/technomancy/chortles: I did "lein run" after exporting the environment variables suggested there and it connects to http://flynn:reindeerflotilla@localhost:5000/repl like a charm. I tried to evaluate simple expressions and I had no problems at all while the server was up&running. I'm using Leiningen 2.4.3 to run it.

Chortle's sources https://github.com/technomancy/chortles/blob/master/src/chortles/web.clj seem to be quite simple, the main handler is wrapped in drawbridge middleware including session and parameters support too. Does that work for you? Is it feasible to use the same approach for your own application?

like image 56
circlespainter Avatar answered Oct 16 '22 19:10

circlespainter