1

I am working on a remote machine over ssh without X, and it has no browser installed. When I invoke browse-url on Emacs (not surprisingly) it gives an error: "No usable browser found."

I can install w3m at the remote machine or forward a graphical browser, but I would like to see the url opened at the local machine with 'browse http://example.com/'. Are there work done on this matter, or if not, how would one write a program that does such a thing(if it is possible at all)?

I've seen this answer, but apparently it can't be used in scripting (when ssh'ing back to the original host is impossible) https://stackoverflow.com/questions/38567427/run-a-command-on-local-machine-while-on-ssh-in-bash

Or if it's impossible I'll just have to forward firefox itself(though slow).

2 Answers 2

0

If the requirement is just to identify the changes the first option comes to my mind is Lynx a command line browser.

The second option is telnet to 80 port and give http commands such as

GET index.html

This will show up raw html page.

Third and another good one is curl

2
  • I need the browser to be able to run javascript, so I think text-based browsers running at the remote host are a no-go. I don't understand what do you mean by the second and the third options. I have a URL at a remote machine, and I need to write a script runs on the remote host that can open a browser at the local machine without ssh'ing back.
    – Haemin Yoo
    Commented Oct 11, 2017 at 8:40
  • If you want the test Javascript then first and second options will not work for you. But If I'm getting you correctly I think you may be able to use CURL. For example curl http://example.com > example.html and then copy the file to your local PC. Open the file with your browser. If this is what you are after you can simply script the same steps.
    – NIK
    Commented Oct 11, 2017 at 11:19
0

maybe the extra-package lynx may help (may be needed to be installed)

this command will open up the page from remote host in console - if i understood the questin well

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .