RetroShare/libresapi/src/api
2018-11-11 20:42:48 +01:00
..
ApiPluginHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ApiPluginHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ApiServer.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ApiServer.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ApiServerLocal.cpp added missing license to some libresapi files 2018-05-21 20:17:54 +02:00
ApiServerLocal.h added missing license to some libresapi files 2018-05-21 20:17:54 +02:00
ApiServerMHD.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ApiServerMHD.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ApiTypes.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ChannelsHandler.cpp Merge branch 'master' into jsonapi 2018-07-23 13:44:01 +02:00
ChannelsHandler.h merged upstream/master 2018-07-08 21:17:48 +02:00
ChatHandler.cpp libresapi fix compile error on windows due to time_t usage 2018-10-07 14:41:14 +02:00
ChatHandler.h libresapi fix compile error on windows due to time_t usage 2018-10-07 14:41:14 +02:00
FileSearchHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
FileSearchHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
FileSharingHandler.cpp merged upstream/master 2018-07-08 21:17:48 +02:00
FileSharingHandler.h merged upstream/master 2018-07-08 21:17:48 +02:00
ForumHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ForumHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
GetPluginInterfaces.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
GetPluginInterfaces.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
GxsMetaOperators.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
GxsResponseTask.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
GxsResponseTask.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
IdentityHandler.cpp libresapi fix compile error on windows due to time_t usage 2018-10-07 14:41:14 +02:00
IdentityHandler.h added missing license to some libresapi files 2018-05-21 20:17:54 +02:00
json.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
json.h updated SuperEasyJSON 2015-03-27 18:43:07 +00:00
JsonStream.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
JsonStream.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
LivereloadHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
LivereloadHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
Operators.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
Operators.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
Pagination.h Disable limit to 20 entries in JSON API pagination 2017-04-03 19:21:54 +02:00
PeersHandler.cpp Fix compilation due to RsPeers::GetRetroshareInvite 2018-10-06 02:46:09 +02:00
PeersHandler.h added missing license to some libresapi files 2018-05-21 20:17:54 +02:00
README.md added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
ResourceRouter.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ResourceRouter.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
RsControlModule.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
RsControlModule.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ServiceControlHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
ServiceControlHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
SettingsHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
SettingsHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
StateTokenServer.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
StateTokenServer.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
StatsHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
StatsHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
TmpBlobStore.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
TmpBlobStore.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
TransfersHandler.cpp fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00
TransfersHandler.h fixed retroshare.project email in licenses 2018-11-11 20:42:48 +01:00

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.