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

Support Unix Domain Sockets for connectivity #932

Open
zinzila opened this issue Apr 21, 2022 · 2 comments
Open

Support Unix Domain Sockets for connectivity #932

zinzila opened this issue Apr 21, 2022 · 2 comments

Comments

@zinzila
Copy link

zinzila commented Apr 21, 2022

Using UDS can be beneficial for local deployments of the client and a broker. It should have better performance and will provide additional security for such scenarios.

Support for unix domain sockets was added to Mosquitto some time ago:
eclipse-mosquitto/mosquitto#1522

@redboltz
Copy link
Owner

redboltz commented Apr 26, 2022

I investigated a litte about Unix Domain Scokets.
Boost.Asio support it.
See https://www.boost.org/doc/libs/1_79_0/doc/html/boost_asio/reference/local__stream_protocol/socket.html

I guess that mqtt_cpp can work with this.

Now, I'm working on re-design endpoint for faster speed and smaller memory consumption on compile time.
So I don't have much time.
But I will support Unix Domain Scokets in the future.

@ineffective
Copy link

I believe that when you get around to it you could investigate whether other types of streams could be supported in a generic manner. Quite probably this could be done by an ability to pass any freshly opened socket/stream to the mqtt client (and/or server). This is an interesting feature because not only local_stream could be used aside from classic sockets, but also async_pipe and maybe other mechanisms.

Also note that on Linux/Unix (not on Windows, where local sockets are supported but in a limited way) unix sockets allow for getting uid (UserId) of the process that opened other side of the connection. I do it in my services to allow only services with specific uid to connect, and then to limit where they can send messages - e.g. some services can send only local messages, others can send only to the remote mqtt server and others can send messages anywhere.

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

3 participants