Closed mphojele closed 4 years ago
It's a bug where impatient mode is not using the proper httpd-host address. Here's a patch that fixes it:
(defun imp-visit-buffer (&optional arg)
"Visit the current buffer in a browser.
If given a prefix argument, visit the buffer listing instead."
(interactive "P")
(unless (process-status "httpd")
(httpd-start))
(unless impatient-mode
(impatient-mode))
(let ((url (format "http://%s:%d/imp/"
(cl-case httpd-host
((nil) "0.0.0.0")
((local) "localhost")
(otherwise httpd-host))
httpd-port)))
(unless arg
(setq url (format "%slive/%s/" url (url-hexify-string (buffer-name)))))
(browse-url url)))
Thank you🤗
On Thu, 07 Nov 2019, 09:44 hackerb9, notifications@github.com wrote:
It's a bug where impatient mode is not using the proper httpd-host address. Here's a patch that fixes it:
(defun imp-visit-buffer (&optional arg) "Visit the current buffer in a browser.If given a prefix argument, visit the buffer listing instead." (interactive "P") (unless (process-status "httpd") (httpd-start)) (unless impatient-mode (let ((url (format "http://%s:%d/imp/" (cl-case httpd-host ((nil) "0.0.0.0") ((local) "localhost") (otherwise httpd-host)) (system-name) httpd-port))) (unless arg (setq url (format "%slive/%s/" url (url-hexify-string (buffer-name))))) (browse-url url))))
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skeeto/impatient-mode/issues/19?email_source=notifications&email_token=AKSYGBCRNL5E5VCN2EBV333QSPBOJA5CNFSM4ISHPQB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDLQNKQ#issuecomment-550962858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKSYGBHWNCGPGHKXSXZRXHDQSPBOJANCNFSM4ISHPQBQ .
I should have closed this issue a long time ago. Sorry.
I'm loving this plugin, very much. However, imp-visit-buffer seems to be confused about hosting because instead of a URL like this
localhost:8080/boo/boo/
it puts the name of my machine as host. There's nothing served there but writing the URL with localhost replacing my machine name works fine. Please help:)