RetroShare/libresapi/src/api
2015-04-25 09:08:54 +00:00
..
ApiServer.cpp - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
ApiServer.h - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
ApiServerMHD.cpp added web interface to retroshare-gui 2015-04-24 14:31:13 +00:00
ApiServerMHD.h added web interface to retroshare-gui 2015-04-24 14:31:13 +00:00
ApiTypes.h - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
FileSearchHandler.cpp added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
FileSearchHandler.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
GetPluginInterfaces.cpp added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
GetPluginInterfaces.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00: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 added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
GxsResponseTask.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
IdentityHandler.cpp Added missing includes for Windows compile. 2015-03-19 10:09:35 +00:00
IdentityHandler.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
json.cpp updated SuperEasyJSON 2015-03-27 18:43:07 +00:00
json.h updated SuperEasyJSON 2015-03-27 18:43:07 +00:00
JsonStream.cpp - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
JsonStream.h - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
Operators.cpp added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
Operators.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
Pagination.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
PeersHandler.cpp webui: fixed bug with peers without locations 2015-04-25 09:08:54 +00:00
PeersHandler.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00: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 - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
ResourceRouter.h - added support for multiple client threads to ApiServer 2015-03-31 18:00:40 +00:00
RsControlModule.cpp allow RsControlModule to work without control over RsInit (e.g. with rs-gui) 2015-03-25 08:31:19 +00:00
RsControlModule.h allow RsControlModule to work without control over RsInit (e.g. with rs-gui) 2015-03-25 08:31:19 +00:00
ServiceControlHandler.cpp added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
ServiceControlHandler.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
StateTokenServer.cpp added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
StateTokenServer.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00:00
TransfersHandler.cpp Added missing includes for Windows compile. 2015-03-19 10:09:35 +00:00
TransfersHandler.h added resource_api and rs-nogui-webui (requires libmicrohttpd, Html files are not included) 2015-03-18 18:48:43 +00: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.