Hopping around the Internet
Frog is a TCP based Internet protocol like http and gopher
Rules of the Frog Protocol:
- Every message has a prefix. Valid prefixes:
- 'p': Ping (Ask for server info)
- No arguments
- Next message must be a server info message
- 'i': Server Info
- Arguments: The server name
- 'r': Server Request
- Arguments: The page being requested
- Requests a page from a server, the request is fullfilled when one of the following messages are received:
- Response: The page that was requested
- Jump: The page should be loaded from another server
- Redirect: The page should be loaded from the same server with a different request
- 's': Server Response
- Arguments: The page that was requested
- 'm': Message to display before the response from the server is sent
- Arguments: The message to display
- Is sent between a request message and the fullfillment of the request
- A message is fullfilled with a Next Message
- 'n': Next Message
- Wait for the client to finish reading the message
- Arguments: Message to display
- 'q': Question for Client
- Arguments: The question to display
- Next message must be an answer
- 'a': Answer from Client
- Arguments: The answer from the client
- 'j': Jump to another server
- Arguments: The IP address to jump to, The page on the server to request
- 'd': Redirect to another page on the same server
- Arguments: The name of the page to redirect to
- 'p': Ping (Ask for server info)
- Messages are in ASCII
- Message Structure
- Prefix (1 Byte/Char)
- String for arguments:
- If there is only 1 argument, the entire string is the argument
- 'The argument can have spaces'
- If there are 2 arguments, the first argument ends after the first ' ' [Space]
- 'argument1 argument 2 can have spaces'
- If there is only 1 argument, the entire string is the argument
- After connecting to a server via TCP, the client must send a ping message
- Client: "p": Ping Server
- Server: "iFrog Protocol Search Engine": The server says it's name is "Frog Protocol Search Engine"
- Client: "rsearch": Client requests the "search" page
- Server: "qSearch Query": Server asks Client for a "Search Query"
- Client: "aFrog Protocol": Client Answers to the "Search Query" Question with "Frog Protocol"
- Server: "sFrog Protocol is an internet protocol like http": The Server Responds with the Page the Client Requested
There is more information on the frog protocol in the PROTOCOL.md document
- A Frog Protocol Client (
frogclient)- Works out of the box
- A Frog Protocol Demo Server (
frogserver)- The source would need to be modified to configure the server
This project uses CMake, build with cmake .
This project relies on SFML, which will be automatically downloaded by CMake for static linking of the used modules. The SFML Network and System Modules are used.