diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index c99e5784..2a242823 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1513,6 +1513,9 @@ lws_socket_bind(struct lws_context *context, int sockfd, int port, return -1; } strcpy(serv_unix.sun_path, iface); + if (serv_unix.sun_path[0] == '@') + serv_unix.sun_path[0] = '\0'; + } else #endif #ifdef LWS_USE_IPV6 diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 4d586ff6..9f584076 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -1375,7 +1375,9 @@ struct lws_protocol_vhost_options { * @iface: NULL to bind the listen socket to all interfaces, or the * interface name, eg, "eth2" * If options specifies LWS_SERVER_OPTION_UNIX_SOCK, this member is - * the pathname of a UNIX domain socket. + * the pathname of a UNIX domain socket. you can use the UNIX domain + * sockets in abstract namespace, by prepending an @ symbole to the + * socket name. * @protocols: Array of structures listing supported protocols and a protocol- * specific callback for each one. The list is ended with an * entry that has a NULL callback pointer.