djblue / portal

A clojure tool to navigate through your data.
https://djblue.github.io/portal/
MIT License
881 stars 82 forks source link

portal/examples/remote example doesn't work #185

Closed gdw2 closed 1 year ago

gdw2 commented 1 year ago

Regarding the remote example (found in portal/examples/remote), I run the server, I run the client and I get a connection refused. Neither can I curl or netcat port 5678. Could this be a problem with portal.api/open?

Server:

$ ./server 
Server running on port: 5678
Babashka v1.3.181 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=>

Client:

$ ./client 
Babashka v1.3.181 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (submit "hi")

{:opts {:headers {"content-type" "application/edn"}, :body "\"hi\"", :method :post, :url "http://localhost:5678/submit"}, :error #error {
 :cause "Connection refused"
 :via
 [{:type java.net.ConnectException
   :message "Connection refused"
   :at [sun.nio.ch.Net pollConnect "Net.java" -1]}]
 :trace
 [[sun.nio.ch.Net pollConnect "Net.java" -1]
  [sun.nio.ch.Net pollConnectNow "Net.java" 672]
  [sun.nio.ch.SocketChannelImpl finishConnect "SocketChannelImpl.java" 973]
  [org.httpkit.client.HttpClient finishConnect "HttpClient.java" 437]
  [org.httpkit.client.HttpClient run "HttpClient.java" 519]
  [java.lang.Thread run "Thread.java" 1589]
  [com.oracle.svm.core.thread.PlatformThreads threadStartRoutine "PlatformThreads.java" 775]
  [com.oracle.svm.core.posix.thread.PosixPlatformThreads pthreadStartRoutine "PosixPlatformThreads.java" 203]]}}

$ nc -z localhost 5678; echo $?
1
gdw2 commented 1 year ago

I ran portal.api/open using jvm clojure and it worked. Maybe it's just a problem with babashka.

djblue commented 1 year ago

Not sure why this was an issue, but bumping to latest portal fixes the issue for me.