


This is how Matrix democratises control over communication.īy default, Matrix uses simple HTTPS+JSON APIs as its baseline transport, but also embraces more sophisticated transports such as WebSockets or ultra-low-bandwidth Matrix via CoAP+Noise. This means that every server has total self-sovereignty over its users data - and anyone can choose or run their own server and participate in the wider Matrix network. Even if your server goes offline, the conversation can continue uninterrupted elsewhere until it returns. There is no single point of control or failure in a Matrix conversation which spans multiple servers: the act of communication with someone elsewhere in Matrix shares ownership of the conversation equally with them. ServerSocket socket.socket() host '127.0.0.1' port 1233 ThreadCount 0 Now let’s bind the host and port to the socket server we created above in the program. If the user types in a message then send it to the server. Along with this let’s declare the host and port on which we need to communicate with clients. The chat client does the following 2 things : Listen for incoming messages from the server. It connects to a remote server, sends messages and receives messages. When you send a message in Matrix, it is replicated over all the servers whose users are participating in a given conversation - similarly to how commits are replicated between Git repositories. The client is based on the telnet program in python. Matrix is really a decentralised conversation store rather than a messaging protocol.
