使用virtualbox错误的苹果酒nREPL:由远程对等方

时间:2018-05-09 16:37:10

标签: clojure cider nrepl

使用以下命令启动repl:

lein repl :headless :port 4242

当我尝试连接VIA cider connect时,出现以下错误:

Connection closed unexpectedly (connection broken by remote peer)

当我尝试连接VIA时:

lein repl :connect 4242

我收到以下错误:

SocketException The transport's socket appears to have lost its connection to the nREPL server
        clojure.tools.nrepl.transport/bencode/fn--5154/fn--5155 (transport.clj:95)
        clojure.tools.nrepl.transport/bencode/fn--5154 (transport.clj:95)
        clojure.tools.nrepl.transport/fn-transport/fn--5126 (transport.clj:42)
        clojure.core/binding-conveyor-fn/fn--4676 (core.clj:1938)
        java.util.concurrent.FutureTask.run (FutureTask.java:266)
        java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
        java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
        java.lang.Thread.run (Thread.java:748)
Bye for now!

1 个答案:

答案 0 :(得分:0)

默认情况下,nrepl仅侦听来自同一台计算机的连接。它通过将其侦听器“绑定”到环回网络127.0.0.1的IP地址来实现此目的。如果您希望它从任何地方侦听连接,您可以将其绑定到0.0.0.0网络地址any或特定适配器的地址。

看起来我需要将主机指定为0.0.0.0,例如

lein repl :headless :host 0.0.0.0 :port 4242