restclient.el icon indicating copy to clipboard operation
restclient.el copied to clipboard

`restclient-mode` on remote hosts (Tramp)

Open siwica opened this issue 5 years ago • 7 comments

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?

siwica avatar Sep 17 '19 12:09 siwica

Of course not. How would you technically see this happening if emacs is running locally?

pashky avatar Sep 17 '19 13:09 pashky

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.

siwica avatar Sep 17 '19 14:09 siwica

Not possible unless you implement launching ssh with suitable port forwarded and then change url-retrieve to connect localhost instead or something like that.

pashky avatar Sep 17 '19 14:09 pashky

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.

siwica avatar Sep 17 '19 14:09 siwica

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.

pashky avatar Sep 17 '19 14:09 pashky

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.

siwica avatar Sep 17 '19 15:09 siwica

I just tried to do this hoping it was implemented :) I'd definitely use it if it existed, helps bypass firewalls etc.

weissjeffm avatar Nov 22 '19 17:11 weissjeffm