Comments (9)
Marked the alias as DEPRECATED and will move to the deps-deprecated.edn file by the next release
from clojure-cli-config.
Maybe I am missing something but I havent been able to replicate the issue you have been experiencing
Are the more details you can supply, e.g. the command used, any network infrastructure being navigated or a project that recreates the issue.
Thanks.
from clojure-cli-config.
After investigating a bit more I think I've found the "real" cause of the problem:
The remote NREPL gets registered with the host localhost (see the printed out nrepl://localhost:44947):
When i execute a netcat command I can't reach the service:
So I think I have to startthe nrepl-Server with the actual host name. The repl/...
commands do have a parameter to specify the host name?
from clojure-cli-config.
Ah yes, I remember the --bind
is a server option is required to set the hostname that the nrepl server starts on. If --bind
is not set, the default locahost IP address is used
❯ clojure -M:repl/rebel --bind 192.168.0.212 --port 44445
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.test.check.generators, being replaced by: #'clojure.test.check.generators/abs
nREPL server started on port 44445 on host 192.168.0.212 - nrepl://192.168.0.212:44445
[Rebel readline] Type :repl/help for online help info
user=>
When connecting via the --connect
option, the --host
option is the client argument that specifies the address set by --bind
on the server
Its quite easy to get --host
and --bind
confused.
The nrepl docs provide some other options, including defining a configuration file.
from clojure-cli-config.
Ah, that's exactly what happened! I've tried it with --host and nothing happened so I thought there is no option for that! 😅 Thanks for the hint!
Now the repl/remote
works like a charm. But the repl/rebel-remote
doesn't seem to use the --host argument.
Sorry, I had to hide the host for security reasons but I can assure that the they go to the same host.
from clojure-cli-config.
Update: sorry, I forgot that --connect
was already included in the alias... try using nrepl as a client alone, without rebel readline
https://nrepl.org/nrepl/usage/clients.html#using-the-built-in-client
I believe the --connect
option is also required as well as the --host
and --port
options
clojure -M:repl/rebel-remote --connect --host hostname --port 8083
I dont have a remote setup at the moment to test.
If the above doesnt work, then try using nrepl directly as a remote REPL client
https://nrepl.org/nrepl/usage/clients.html#using-the-built-in-client
from clojure-cli-config.
I have only managed to get a remote connection by first establishing an SSH forwarding connection. This only seems to work with nrepl connect command locally, using the :repl/rebel-remote
rebel readline alias does not seem to know about the remote repl state :(
Remote server
Start the REPL process on the remote machine, specifying the port
clojure -M:repl/basic --port 1234
SSH tunnel
Create an ssh local forward tunnel to the remote machine
ssh -L :1234:192.168.0.212:1234 [email protected] -N -v
This will prompt for the user password, e.g. practicalli is the name of the user account on the remote machine.
192.168.0.212 is the IP address of the local machine and 192.168.0.238 is the IP address of the remote machine (replace with your own IP addresses)
Local connection
On the local machine (in a separate terminal prompt), connect to the local port and and nrepl commands will be sent via SSH to the REPL process running on the remote server.
clojure -M:repl/basic --connect --host localhost --port 1234
Testing
At the REPL prompt on the remote server, define a var, e.g.
(def remote-value 42)
At the REPL prompt on the local server, evaluate the var name
remote-value
This should display the value 42 in the local repl prompt.
The process is simpler if using Emacs
cider-connect-clj
to connect to the remote repl :)
from clojure-cli-config.
If using Emacs Cider as the local REPL connection, define a local SSH connection in the .ssh/config
file.
Host gkar-repl
HostName 192.168.0.238
# IdentityFile /home/practicalli/.local/joint-clojure-machine.pem
User practicalli
PasswordAuthentication yes
LocalForward 1234 localhost:1234
Port 22
Uncomment the
IdentityFile
if there are pem certificates available. Otherwise Emacs Cider will prompt for the user account password on the remote machine.
In Emacs, run the cider-connect-clj
command and select the Host definition from the list of connections, e.g. gkar-repl or enter the IP address of the remote server
Enter the port, e.g 1234
Emacs cider should connect to the remote repl state.
from clojure-cli-config.
Thanks for the thorough testing!
I've managed to connect via SSH tunnel and Cider and it works!
But in summary we can definitely say that repl/rebel-remote
ignores --host and --port parameters.
Which is fine for me if I know the limitations but on the other hand the command is misleading as it implies that it is possible to connect to a remote REPL.
from clojure-cli-config.
Related Issues (20)
- Accidentally removed "clone" from git installation command in README HOT 1
- Migrate :project/jar and :project/uberjar aliases to tools.build HOT 7
- Windows and Clojure CLI - escape character issues HOT 7
- Project License? HOT 1
- Would you consider adding scope-capture to the inspect section? HOT 2
- :mvn/local-repo appears to be broken as it is relative HOT 1
- [clojure-deps-edn] Create Pull Request template to guide contributions
- Error when using :search/outdated HOT 3
- `:project/outdated` is mentioned in comments but it looks like it was renamed to `:search/outdated`
- User level deps.edn - november update dependencies to latest versions
- refactor: deprecate unused aliases for simpler config HOT 1
- sayid alias requires middleware
- Reveal has disappeared? HOT 4
- Update repo name and branch
- clj-kondo improvements HOT 6
- Add clj-depend tool HOT 1
- Monthly version update
- support Clerk as inspector ? HOT 4
- deps-new Invalid Tag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clojure-cli-config.