A protocol gateway for the web.
Sockethub is a translation layer for web applications to communicate with other protocols and services that are traditionally either inaccessible or impractical to use from in-browser JavaScript.
Using ActivityStream (AS) objects to pass messages to and from the web app, Sockethub acts as a smart proxy server/agent, which can maintain state, and connect to sockets, endpoints, and networks that would otherwise, be restricted from an application running in the browser.
Originally inspired as a sister project to RemoteStorage, and assisting in the development of unhosted and noBackend applications, Sockethub's functionality can also fit into a more traditional development stack, removing the need for custom code to handle various protocol specifics at the application layer.
Example uses of Sockethub are:
-
Writing and receiving messages (SMTP, IMAP, Nostr ...)
-
Chat (XMPP, IRC, SimpleX, ...)
-
Discovery (WebFinger, RDF(a), Link preview generation ...)
The architecture of Sockethub is extensible and supports easy implementation of additional 'platforms' to carry out tasks.
See the Sockethub wiki for documentation.
We use ActivityStreams to map the various actions of a platform to a set of AS '@type's which identify the underlying action. For example, using the XMPP platform, a friend request/accept cycle would use the activity stream types 'request-friend', 'remove-friend', 'make-friend'.
Below is a list of platform contexts we're currently working on and their types,
both the completed and not yet implemented ones. They are all implemented in
Sockethub platforms (each in their own repository) and can be enabled/disabled
in the config.json
.
Making a platform is as simple as creating a platform module that defines a schema and a series of functions that map to verbs. Take a look at some of our existing platforms for examples.
To get up and running quickly, you only need the following commands:
bun install
bun run dev
bun install
bun run build
bun test
bun run lint
Or, to automatically fix linting errors:
bun run lint:fix
bun run integration
For development purposes, with examples enabled, run:
DEBUG=sockethub* bun run dev
You should then be able to browse to http://localhost:10550
and try out the examples.
For production, with examples disabled.
DEBUG=sockethub* bun run start
For more info on configuration options, see the Sockethub README section on environment variables.*
- sockethub
- @sockethub/activity-streams
- @sockethub/client
- @sockethub/crypto
- @sockethub/data-layer
- @sockethub/examples
- @sockethub/irc2as
- @sockethub/platform-dummy
- @sockethub/platform-feeds
- @sockethub/platform-irc
- @sockethub/platform-xmpp
- @sockethub/schemas
- @sockethub/server
Project created and maintained by Nick Jennings
Logo design by Jan-Christoph Borchardt
Sponsored by NLNET