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

wrong-type-argument websocket nil #37

Open
nelsonov opened this issue Jul 11, 2020 · 4 comments
Open

wrong-type-argument websocket nil #37

nelsonov opened this issue Jul 11, 2020 · 4 comments

Comments

@nelsonov
Copy link

I am trying to configure markdown-preview-mode for remote access rather than launching a browser. I'm trying to follow the directions in the README. I have created the following:

(use-package markdown-preview-mode
  :ensure t
  :if (boundp 'mdcommand)
  :init
  (setq markdown-preview-auto-open nil)
  :custom
  (markdown-preview-host "0.0.0.0")
  (markdown-preview-http-host "0.0.0.0"))

When markdown-preview-mode is enabled, it continuously prints the following error in the mini buffer:
====> Error: (wrong-type-argument websocket nil)

What am I doing wrong?

@ancane
Copy link
Owner

ancane commented Jul 11, 2020

Hey. 0.0.0.0 is a conventional address, meaning, listen all the IP4 IPs available. Probably, you got more than one address, and listening to some of them is just not possible. Please, try setting the one that you are going to establish a remote connection to (which I don't know obviously, and that's why I put 0.0.0.0 in the doc). If that doesn't work, we'll continue debugging.

@nelsonov
Copy link
Author

I like that 0.0.0.0 is a possibility. I keep my emacs config in version control and use the same config across dozens of machines. Having a generic IP like this is obviously preferable.

However, I put in my test machine's assigned IP in the config and still have the same problem. I also tried 127.0.0.1. I then noticed that no matter what I enter in the config, when the URL is reported in the mini-buffer, it is always 0.0.0.0. As of my last test, there is no occurrence of 0.0.0.0 anywhere in my config. I shutdown and restart emacs between each test to be sure that there is nothing hanging around. However, the reported URL still has 0.0.0.0 for its IP.

Here is the current config:

(use-package markdown-preview-mode
  :ensure t
  :if (boundp 'mdcommand)
  :init
  (setq markdown-preview-auto-open nil)
  :custom
  (markdown-preview-ws-port 9010)
  (markdown-preview-host "100.115.92.200")
  (markdown-preview-http-host "100.115.92.200"))

Here's is my test machine's ip info

> ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
5: eth0@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:05:18:e7 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 100.115.92.200/28 brd 100.115.92.207 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2001:5b0:49d0:34e:216:3eff:fe05:18e7/64 scope global dynamic mngtmpaddr 
       valid_lft 86262sec preferred_lft 7062sec
    inet6 fe80::216:3eff:fe05:18e7/64 scope link 
       valid_lft forever preferred_lft forever

@nelsonov
Copy link
Author

I just tested on a different machine who's IP is 192.168.42.101. However, even after putting that IP in the config, I still see:

Preview address: http://0.0.0.0:9000/?uuid=e93b7b39-aa8f-482a-8acc-8a9ca07a8187

This is the first time markdown-preview-mode has ever run on this machine. It was installed as a part of the test just a few minutes ago. This is the config:

(use-package markdown-preview-mode
  :ensure t
  :if (boundp 'mdcommand)
  :init
  (setq markdown-preview-auto-open nil)
  :custom
  (markdown-preview-ws-port 9010)
  (markdown-preview-host "192.168.42.101")
  (markdown-preview-http-host "192.168.42.101"))

@ancane
Copy link
Owner

ancane commented Jul 21, 2020

Ah. That message was hardcoded. http://192.168.42.101:9000 should have worked for you.
My plan is to upgrade to the latest stable versions of all the dependencies soon and I'll fix that message too.
My apologies.

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