A "proxy" microservice that runs Matrix C-S /sync
on the server and pushes
to-device events and other encryption-related things through the usual
appservice transaction system.
This was designed for use with mautrix-wsproxy and the android-sms bridge to significantly reduce battery usage of the persistent foreground process (an idle websocket doesn't take much battery, but a HTTP request every 30 seconds does).
This partially implements MSC3202 and the to-device part of MSC2409.
You can download a prebuilt executable from the CI or GitHub releases. The executables are statically compiled and have no dependencies. Alternatively, you can build from source:
- Have Go 1.16 or higher installed.
- Clone the repository (
git clone https://github.com/mautrix/syncproxy.git
). - Build with
go build -o mautrix-syncproxy
. The resulting executable will be in the current directory namedmautrix-syncproxy
.
Configuring is done via environment variables.
LISTEN_ADDRESS
- The address where to listen.HOMESERVER_URL
- The address to Synapse. If using workers, it is sufficient to have access to theGET /sync
andPOST /user/{userId}/filter
endpoints.DATABASE_URL
- Database for storing sync tokens. SQLite and Postgres are supported:sqlite:///mautrix-syncproxy.db
orpostgres://user:pass@host/db
SHARED_SECRET
- The shared secret for adding new sync targets. You should generate a random string here, e.g.pwgen -snc 50 1
DEBUG
- If set, debug logs will be enabled.
Since this is most useful with mautrix-wsproxy, the docker-compose instructions can be found in the mautrix-wsproxy readme.