diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-05-04 15:40:22 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-05-29 16:44:48 +0200 |
commit | 39594b801dc041d40b1348bf2efcf6f64215cd60 (patch) | |
tree | e88be6be4147149ade787ea5132724e0c63fcbd7 /unix | |
parent | 621580d7a8d39ab7beac255d747af9fe6998063a (diff) | |
download | tigervnc-39594b801dc041d40b1348bf2efcf6f64215cd60.tar.gz tigervnc-39594b801dc041d40b1348bf2efcf6f64215cd60.zip |
Unix socket support in x0vncserver
Diffstat (limited to 'unix')
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 12 | ||||
-rw-r--r-- | unix/x0vncserver/x0vncserver.man | 9 |
2 files changed, 19 insertions, 2 deletions
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index db917975..c08572be 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -31,6 +31,7 @@ #include <rfb/Configuration.h> #include <rfb/Timer.h> #include <network/TcpSocket.h> +#include <network/UnixSocket.h> #include <vncconfig/QueryConnectDialog.h> @@ -58,6 +59,8 @@ IntParameter maxProcessorUsage("MaxProcessorUsage", "Maximum percentage of " "CPU time to be consumed", 35); StringParameter displayname("display", "The X display", ""); IntParameter rfbport("rfbport", "TCP port to listen for RFB protocol",5900); +StringParameter rfbunixpath("rfbunixpath", "Unix socket to listen for RFB protocol", ""); +IntParameter rfbunixmode("rfbunixmode", "Unix socket access mode", 0600); IntParameter queryConnectTimeout("QueryConnectTimeout", "Number of seconds to show the Accept Connection dialog before " "rejecting the connection", @@ -307,8 +310,13 @@ int main(int argc, char** argv) QueryConnHandler qcHandler(dpy, &server); server.setQueryConnectionHandler(&qcHandler); - createTcpListeners(&listeners, 0, (int)rfbport); - vlog.info("Listening on port %d", (int)rfbport); + if (rfbunixpath.getValueStr()[0] != '\0') { + listeners.push_back(new network::UnixListener(rfbunixpath, rfbunixmode)); + vlog.info("Listening on %s (mode %04o)", (const char*)rfbunixpath, (int)rfbunixmode); + } else { + createTcpListeners(&listeners, 0, (int)rfbport); + vlog.info("Listening on port %d", (int)rfbport); + } const char *hostsData = hostsFile.getData(); FileTcpFilter fileTcpFilter(hostsData); diff --git a/unix/x0vncserver/x0vncserver.man b/unix/x0vncserver/x0vncserver.man index 5c8729e2..5dc0b052 100644 --- a/unix/x0vncserver/x0vncserver.man +++ b/unix/x0vncserver/x0vncserver.man @@ -66,6 +66,15 @@ Use IPv4 for incoming and outgoing connections. Default is on. Use IPv6 for incoming and outgoing connections. Default is on. . .TP +.B \-rfbunixpath \fIpath\fP +Specifies the path of a Unix domain socket on which x0vncserver listens for +connections from viewers, instead of listening on a TCP port. +. +.TP +.B \-rfbunixmode \fImode\fP +Specifies the mode of the Unix domain socket. The default is 0600. +. +.TP .B \-Log \fIlogname\fP:\fIdest\fP:\fIlevel\fP Configures the debug log settings. \fIdest\fP can currently be \fBstderr\fP, \fBstdout\fP or \fBsyslog\fP, and \fIlevel\fP is between 0 and 100, 100 meaning |