I had an idea for this protocol, and I want to hear your thoughts and improvements,
and ideas for implementations.
I want to host the lan server on a Haiku box, so no servers that don’t run on Haiku
Lan Mail Protocol
Connection
Request (client)
AUTH USER <username>
AUTH PASSWD <password>
Response (server)
Valid:
AUTH ACCEPTED
Invalid:
AUTH REJECTED
Response (server) (If new messages for client)
Send
Request (client)
SEND <message length in bytes>
<message content>
TO <user>
Response (server)
Success:
SEND OK
Failure:
SEND FAILED
Receive
If the target is connected to the server:
Message (server)
NEW
When the client receives NEW:
Request (client)
GET
Response (server)
For each message server has for client
HAVE <message id>
Response (client)
If client has a message with that id
HAVE YES
Server then goes to next message
If client does not have a message with that id
HAVE NO
Response (server)
MESSAGE <message id>
SIZE <message length in bytes>
<message content>
FROM <user>
TO <user>
TIME <timestamp>
That’s what it is, although there is nothing stopping you from exposing it to the internet (besides common sense).
But it is not messaging as in chat like irc, it is closer to email.
Dukto is a nice solution but is no longer officialy maintained (maybe somebody continued it, did not look).
There may also be Zeroconf/Avahi based chat solutions that can be used as an inspiration (Pidgin has a module for it I think, but I have not used it for years). It would then be a mater of porting/plugging the existing Zeroconf library to Chat-o-Matic or Renga. No idea of the difficulty though.
Indeed, hence my comment on checking how Pidgin implemented a simple messaging plugging (and maybe file transfer, can’t remember that one) on top of Apple Bonjour (Zeroconf) protocol.
You cannot. What you call bonjour or zeroconf is just DNS Service discovery over multicast DNS for local area networks.
This is not a communication protocol, it only facilitates publishing services in a LAN via DNS, nothing more. You can’t build a communication service “ontop” of it. You can only use it to discover a server, at which point you will have to implement your own server and client or use existing ones.