@node Protocol
@unnumbered Protocol
-Protocol is very simple: @url{https://en.wikipedia.org/wiki/Bencode, bencode}d
-dictionary is sent over TCP.
-
-@itemize
-@item @code{v} key contains the data you want to paste
-@item optional @code{e} key, holding the desired filename extension,
- without the leading dot, up to 9 characters long
-@end itemize
+Protocol is very simple: two
+@url{https://en.wikipedia.org/wiki/Netstring, netstring}s are sent over TCP.
+First one holds desired filename extension, without the leading dot, up to 9
+characters long. Second one is the paste data itself.
@example
-"hello world" => d1:v11:hello worlde
-"http://example.com/" and "url" extension => d1:e3:url1:v18:http://example.come
+ "hello world", no explicit extension => 0:,11:hello world,
+"http://example.com/", "url" extension => 3:url,18:http://example.com,
@end example