Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networking issue for opening Slynk port to Emacs #6

Closed
ag91 opened this issue Oct 21, 2021 · 2 comments
Closed

Networking issue for opening Slynk port to Emacs #6

ag91 opened this issue Oct 21, 2021 · 2 comments

Comments

@ag91
Copy link

ag91 commented Oct 21, 2021

I am so amazed by your idea of using Docker to bridge Mac OS and Nyxt: I have just finished experimenting with it and it is just amazing!!

There is one issue that I seem not be able to solve: I would like to connect Emacs to Nyxt via port 4006 but anytime I try with Sly it fails!

This is my setup (after your installation instructions):

in my .zshrc

alias nyxt="xterm -e 'xhost +127.0.0.1; docker run -it -p 4006:4006 -v /Users/andrea:/root/ --rm bigdeddu/nyxt:2.2.1'"

And I have the following config file: https://github.com/ag91/emacs-with-nyxt/blob/master/auto-config.lisp
that is in the usual location /Users/andrea/.config/nyxt/auto-config.lisp

Nyxt side things work but it seems that 4006 breaks the connection:

[sly] Connecting to Slynk on port 4006..
[sly] Lisp connection closed unexpectedly: connection broken by remote peer

And if there were no connection, the error would be:

[sly] Connecting to Slynk on port 4005..
helm-M-x-execute-command: make client process failed: Connection refused, :name, sly-4, :buffer, nil, :host, localhost, :service, 4005, :nowait, nil, :tls-parameters, nil

So it seems my port forwarding is working, any chance you know why this is happening?

Thanks again for this amazing Docker image !!

(I tried also with Slime and start-swank, and the connection is also broken with this setup)

@ag91 ag91 changed the title Networking issue for opening Slyink port to Emacs Networking issue for opening Slynk port to Emacs Oct 21, 2021
@deddu
Copy link
Owner

deddu commented Oct 23, 2021

thanks, im glad you find this useful!

If I understood correctly, I think the issue is lurking somewhere in the network between the host and the container. I wonder if slynk uses some host locked to 127.0.0.1 like other webservers do. I did not had time to try it yet, but I would check this:

  1. check if slynk has an external host option and try to set that to 0.0.0.0 to allow external (from outside the container) connections
  2. see if you can telnet/netcat to the port from within the container, by docker exec into it.

Thanks for sharing your configuration, I’ll try to run it as soon as I get a chance. ( I just got a newborn and I’ve 3 more kids, time is a bit of a problem rn)

@ag91
Copy link
Author

ag91 commented Oct 25, 2021

@deddu Congratulations!!! Sorry to take your time from such a great event :D Congrats again!
And you solved it!!!
I just needed to use (slynk:create-server :port slynk-port :dont-close t :interface "0.0.0.0") as you suggested and things work now. By default slynk was using the localhost interface, which most likely translated to the locked address. I updated my configuration as well.
Just amazing that now I can use Nyxt on MacOS. Great job again and a lot of happiness for you all ;)

@ag91 ag91 closed this as completed Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants