restclient.el
restclient.el copied to clipboard
`restclient-mode` on remote hosts (Tramp)
I am using Emacs to work on a remote host via Tramp/SSH. However, when working with a buffer in restclient-mode
associated with a file on a remote host, running restclient-http-send-current
seems to issue the respective request from the host I am running Emacs on rather than from the remote host (desired behavior).
Does restclient-mode
allow me to specify that I want the requests issued from the remote host instead?
Of course not. How would you technically see this happening if emacs is running locally?
Well, if I run M-x eshell
in a buffer visiting a local file it opens a local shell, if I run the same command in a buffer visiting a remote file, it opens a remote shell over SSH.
So my goal is to issue the requests from the remote host (via SSH) when I use restclient-mode
with a buffer visiting a remote file.
Not possible unless you implement launching ssh with suitable port forwarded and then change url-retrieve to connect localhost instead or something like that.
Do you think that would be a reasonable feature request? restclient.el could call curl
over SSH if available on the remote host in case the buffer is visiting a remote file.
Sure, feel free to make a PR and I’ll merge. There’s rudimentary curl sort-of support - a function that generates command into clipboard.
Ok, I see what I can do. Won't be happening in the all to near future, but I will keep it in the back of my mind.
I just tried to do this hoping it was implemented :) I'd definitely use it if it existed, helps bypass firewalls etc.