you read it, it’s basically like the web, except it’s piss simple, only has one request type, and is really easy to implement (assuming you are using Mayernet 1, without encryption)

Mayernet uses json to transmit metadata and markdown as markup language of choice. this makes it very easy to render documents

it’s an extremely simple and light protocol so it’s really piss easy to implement; it has an extremely simple format. it uses newlines to separate fields such as in the client->server request (URL + newline + BODY)

it’s made to be extremely quick to grasp and understand, even as a human user looking through TCP socket conversations (though i’ll have to admit it’s kind of a problem: it’s not only easy to parse for clients, it also is for snitches!)

so yeah Mayernet 1 does not include encryption yet, but you may propose a way to implement encryption in the protocol.

--- standard
When setting up a Mayernet server, try to use port 2022.

--- non-secure version, Mayernet 1, most simple to implement
CLIENT opens connection
SERVER accepts connection
CLIENT sends request (url and body)
SERVER sends response header and terminates under error conditions
CLIENT sends acknowledgement
SERVER sends response body
SERVER closes connection

-- request:
A request is formatted like this:
URL<newline>JSONBODY

URL is an absolute URL, which lets us host multiple websites on the same IP address.
JSONBODY is optional, it represents data to send to the server.

-- response:
- header:
A response header is formatted like this:
STATUS<newline>META

STATUS is a string made of one letter and one digit and indicates how the client should behave.
META is additional data for the client to parse (e.g. : an input prompt if status is i0)

- statuses:
iX: input - the client should ask for a line of input and resubmit the request to the server with the "input" property in the body. META should be the prompt.
sX: success - request handled successfully, META should be the MIME type of the response body.
rX: redirect - the server redirects the client to a new location to browse. META should be the new location.
fX: temp failure - the request has failed for now. META can be additional information about the error that should be displayed to the user.
FX: perm failure - the request has failed and will fail in the future. META ^