I have X forwarding between two machines. I doubt it matters, but the local machine is Windows running PuTTY and Xming.

Is there any way that I can click a web link on a remote application and have it open the link in the local web browser? If so, how would I do this?

At present if opens a browser on the remote end, displaying it on the local end. However I prefer the local browser, both because of latency (X11 over SSH is slow) and because the local browser is configured the way I like.

It should be possible to set something up with an SSH-tunneled port, changing the BROWSER environment variable on the remote machine to something which will send a message along the port, and having something listen on the local machine to open any given link in the local machine's default browser. However, this seems inelegant, cumbersome, and easy to mess up. Is there a better solution?

  • 1
    This is possible in principle, and does not require any kind of "extra" forwarded port. You'd communicate using the X11 protocol in much the same way that copy & paste and other X11 communication between applications on the same $DISPLAY works. I don't think there is anything ready-made for doing it though; you'd have to code it. – Celada Jun 3 '15 at 17:00
  • @Celada I know little enough about the X11 protocol that it would be easier for me to use my suggestion, although yours does look like a better option if it does exist. – Daniel H Jun 8 '15 at 17:14
  • A quick two step hack would be to setup your default remote browser to be a script that simply dumped the link to stdout, then any time you open a remote link you just have to click on it in the terminal window. – Caleb Jun 10 '15 at 13:15
  • Which might indeed work, because I haven't gotten PuTTY to not bother displaying the terminal window even though I only use X11 on this connection. I'll try that. – Daniel H Jun 10 '15 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.