emacs_chrome icon indicating copy to clipboard operation
emacs_chrome copied to clipboard

Cannot run edit server on another computer

Open axelson opened this issue 15 years ago • 4 comments

Currently the edit server is hard-coded to 127.0.0.1 so it cannot be run on a separate "computer" from the computer that chrome is running on. This would be handy for me because I am currently running emacs under AndLinux which basically acts like a virtual machine with the IP 192.168.11.150.

I've spent some time trying to run it with this alternate IP address, if I navigate to the IP in a browser it says that the edit server is running. But the options page of emacs chrome is unable to find the emacs server, although the log in the emacs server (using edit.el) looks fine and reports that it is returning a 200 ok message.

I will try to post my code on Saturday if anyone wants to look at it. Of course, enabling this may be considered a security hole, perhaps it would be better to tunnel the traffic, which I actually should have tried first.

axelson avatar Jan 29 '10 08:01 axelson

Yeah I did back of the permissions for the extension a little as they are fairly wide ranging. However technically it's not a hard change to make. The files that currently would need updating are:

  • manifest.json - increase permissions for the background page
  • xmlcomms.js - where the edit requests are sent
  • options.html - add an option for the address

stsquad avatar Jan 29 '10 08:01 stsquad

Hmm, I hadn't looked at manifest.json, but changing the 127.0.0.1 to * didn't fix it for me. I think it was also necessary to edit edit.el since I think by default it restricts itself to localhost.

axelson avatar Jan 29 '10 09:01 axelson

Sure, I've uploaded a update to the git repo.

(setq edit-server-host "10.0.0.166")

To enable edit-server.el binding to a specific IP rather than localhost. I've defaulted to localhost only binding as opening a port to a public IP has potential security ramifications.

stsquad avatar Jan 29 '10 11:01 stsquad

BTW, although the edit server can now bind to a non-local port the permissions in the manifest will stop Chrome from sending it's request beyond localhost. I'm happy to do that if someone provides a patch for optionally configuring a remote address.

stsquad avatar Feb 09 '10 16:02 stsquad