RetroShare/libresapi/src/api
2016-06-16 20:19:03 -04:00
..
ApiPluginHandler.cpp
ApiPluginHandler.h
ApiServer.cpp second pass over compilation warnings 2016-06-05 11:05:52 -04:00
ApiServer.h
ApiServerMHD.cpp second pass over compilation warnings 2016-06-05 11:05:52 -04:00
ApiServerMHD.h
ApiTypes.h
ChannelsHandler.cpp libresapi: added channels/create_post 2016-02-19 19:23:55 +01:00
ChannelsHandler.h libresapi: added channels/create_post 2016-02-19 19:23:55 +01:00
ChatHandler.cpp Merge pull request #351 from PhenomRetroShare/Add_WebUI_ClearButtonOnBradCast 2016-06-05 11:26:29 -04:00
ChatHandler.h Add a Clear button on WebUI 2016-04-08 01:31:36 +02:00
FileSearchHandler.cpp
FileSearchHandler.h
ForumHandler.cpp
ForumHandler.h
GetPluginInterfaces.cpp
GetPluginInterfaces.h libresapi: added statetoken to identity handler responses 2016-02-07 14:28:45 +01:00
GxsMetaOperators.h
GxsResponseTask.cpp libresapi: added chat/receive_status 2016-02-14 14:57:41 +01:00
GxsResponseTask.h libresapi: added chat/receive_status 2016-02-14 14:57:41 +01:00
IdentityHandler.cpp pass over compiler warnings 2016-06-05 10:43:57 -04:00
IdentityHandler.h libresapi: added statetoken to identity handler responses 2016-02-07 14:28:45 +01:00
json.cpp second pass over compilation warnings 2016-06-05 11:05:52 -04:00
json.h
JsonStream.cpp
JsonStream.h
LivereloadHandler.cpp
LivereloadHandler.h
Operators.cpp
Operators.h
Pagination.h Add a Clear button on WebUI 2016-04-08 01:31:36 +02:00
PeersHandler.cpp second pass over compilation warnings 2016-06-05 11:05:52 -04:00
PeersHandler.h
README.md
ResourceRouter.cpp pass over compiler warnings 2016-06-05 10:43:57 -04:00
ResourceRouter.h
RsControlModule.cpp pass over compiler warnings 2016-06-05 10:43:57 -04:00
RsControlModule.h
ServiceControlHandler.cpp webui: view / change rights per user 2016-03-22 16:33:05 +01:00
ServiceControlHandler.h webui: view / change rights per user 2016-03-22 16:33:05 +01:00
StateTokenServer.cpp mark empty list as list in libresapi statetokenserver 2016-01-03 16:33:09 +01:00
StateTokenServer.h
TmpBlobStore.cpp
TmpBlobStore.h
TransfersHandler.cpp pass over compiler warnings 2016-06-05 10:43:57 -04:00
TransfersHandler.h

New programming interface for Retroshare

  • access to libretroshare for webinterfaces, QML and scripting
  • client - server architecture.
  • network friendly: transport messages over high latency and low bandwidth networks
  • multiple clients: can use scripting and webinterface at the same time
  • simple packet format: no special serialiser required
  • simple protocol: one request creates one response. A requets does not depend on a previous request.
  • automatic state change propagation: if a resource on the server changes, the clients will get notified
  • no shared state: Client and server don't have to track what they send each other.
  • works with all programming languages

How does it work?

- Client sends a request: adress of a resource and optional parameters encoded as JSON
{
	"method": "get",
	"resource": ["peers"],
}
- Server sends a Response:
{
	"returncode": "ok",
	"statetoken": "ASDF",
	"data": [...]
}

- Client asks if data is still valid
{
	"method": "exec",
	"resource": "statetokenservice"
	"data": ["ASDF", "GHJK"]
}
- Server answers Client that statetoken "ASDF" expired
{
	"returncode": "ok",
	"data": ["ASDF"]
}

Transport

A transport protocol transports requests and responses between client and server.

  • tracks message boundaries, so messages don't get merged
  • may be able to handle concurrent requests with out of order delivery of responses
  • knows to which request a response belongs to

Transport could do encryption and authentication with a standardized protocol like SSH or TLS.

Ideas:

  • request id + length + request data -> SSH -> TCP -> ...
  • Websockets
  • Retroshare Items
  • Unix domain sockets

Currently only unencrypted http is implemented. libmicrohttpd (short MHD) is used as http server. Can use a proxy to add TLS encryption.

Message encoding

Currently JSON, because it is already available in JavaScript and QML. Other key-value encodings could be used as well. Read more about basic data types of different languages (JavaScript, QML, Lua, C++) in ./ApiServer.cpp.