emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/websocket 7422064ea6 035/114: Add a way to specify webs


From: ELPA Syncer
Subject: [elpa] externals/websocket 7422064ea6 035/114: Add a way to specify websocket-server listen host
Date: Wed, 15 Feb 2023 20:58:57 -0500 (EST)

branch: externals/websocket
commit 7422064ea6d39dc256fd4e583f13579602772536
Author: Christopher Warrington <christopher@mygcw.net>
Commit: Christopher Warrington <christopher@mygcw.net>

    Add a way to specify websocket-server listen host
    
    This adds the `:host' keyword to `websocket-server', which lets the
    listen host be controlled. This is useful when you only want to listen
    on localhost, potentially avoiding things like firewall prompts.
---
 websocket.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/websocket.el b/websocket.el
index 1b0b29436a..3b048da95c 100644
--- a/websocket.el
+++ b/websocket.el
@@ -820,6 +820,11 @@ of populating the list of server extensions to WEBSOCKET."
 
 (defun* websocket-server (port &rest plist)
   "Open a websocket server on PORT.
+If the plist contains a `:host' HOST pair, this value will be
+used to configure the addresses the socket listens on. The symbol
+`local' specifies the local host. If unspecified or nil, the
+socket will listen on all addresses.
+
 This also takes a plist of callbacks: `:on-open', `:on-message',
 `:on-close' and `:on-error', which operate exactly as documented
 in the websocket client function `websocket-open'.  Returns the
@@ -833,6 +838,7 @@ connection, which should be kept in order to pass to
                 :log 'websocket-server-accept
                 :filter-multibyte nil
                 :plist plist
+                :host (plist-get plist :host)
                 :service port)))
     conn))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]