{"id":17108462,"url":"https://github.com/g-andrade/backwater","last_synced_at":"2026-03-05T16:14:25.604Z","repository":{"id":51353832,"uuid":"96945000","full_name":"g-andrade/backwater","owner":"g-andrade","description":"Intercluster RPC for Erlang and Elixir","archived":false,"fork":false,"pushed_at":"2023-10-01T18:36:11.000Z","size":675,"stargazers_count":48,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-09T19:51:48.494Z","etag":null,"topics":["distribution-independent","elixir","erlang","intercluster","rpc"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/backwater/","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/g-andrade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-11T23:19:06.000Z","updated_at":"2024-09-12T12:36:55.000Z","dependencies_parsed_at":"2024-10-14T16:05:32.445Z","dependency_job_id":"cd28a808-1cf4-4720-aafc-9e77be25f815","html_url":"https://github.com/g-andrade/backwater","commit_stats":{"total_commits":442,"total_committers":1,"mean_commits":442.0,"dds":0.0,"last_synced_commit":"bdaa01b3ba5292e06c26732994950451fe64ab22"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/g-andrade/backwater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Fbackwater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Fbackwater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Fbackwater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Fbackwater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g-andrade","download_url":"https://codeload.github.com/g-andrade/backwater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Fbackwater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276663090,"owners_count":25682201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distribution-independent","elixir","erlang","intercluster","rpc"],"created_at":"2024-10-14T16:05:26.139Z","updated_at":"2025-09-23T23:18:32.166Z","avatar_url":"https://github.com/g-andrade.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# backwater\n\n**This library is not under continuous maintenance; if you'd like to perform\nmaintenance yourself, feel free to open an issue requesting access.**\n\n[![](https://img.shields.io/hexpm/v/backwater.svg?style=flat)](https://hex.pm/packages/backwater)\n[![](https://github.com/g-andrade/backwater/actions/workflows/ci.yml/badge.svg)](https://github.com/g-andrade/backwater/actions/workflows/ci.yml)\n[![Erlang Versions](https://img.shields.io/badge/Supported%20Erlang%2FOTP-22%20to%2026-blue)](https://www.erlang.org)\n\n### Backwater - Intercluster RPC for Erlang and Elixir\n\n`backwater` allows you to call remote modules without depending on the\nErlang distribution protocol.\n\nIt's targeted at scenarios where nodes in one datacenter need to call\nnodes in another datacenter, over unsecure or unstable networks.\n\n#### Usage\n\nRun `make shell` to bring up a shell. We're going to expose the\n`string` module and call it remotely.\n\n##### 1. Generate a secret\n\n``` erlang\nSecret = crypto:strong_rand_bytes(32).\n```\n\n##### 2. Start the server\n\n``` erlang\nbackwater:start_clear_server(Secret, [string]).\n% {ok, _ServerPid}\n```\n\n##### 3. Execute a remote call\n\n``` erlang\nbackwater:call({\"127.0.0.1\", Secret}, string, to_upper, [\"hello\"]).\n% {ok, \"HELLO\"}\n```\n\n#### Details\n\n`backwater` is built on top of\n[cowboy](https://github.com/ninenines/cowboy) and\n[hackney](https://github.com/benoitc/hackney).\n\n##### Requirements\n\n  - Erlang/OTP 22 or higher\n  - rebar3\n\n##### Documentation\n\nDocumentation is hosted on [HexDocs](https://hexdocs.pm/backwater/).\n\n##### Authentication and integrity\n\nAll requests and responses are authenticated and signed using a modified\nversion of [HTTP\nsignatures](https://tools.ietf.org/id/draft-cavage-http-signatures-07.txt);\nnevertheless, it's **strongly** recommended to use HTTPS, as HTTP\nsignatures offer no protection against replay attacks - besides risking\nexposure of sensitive data.\n\n##### Exceptions\n\nBy default, remote exceptions are returned as errors on the caller's\nside. This behaviour can be tweaked using the\n`rethrow_remote_exceptions` flag in `:call/5` options.\n\nRemote stack traces are returned by default. Because they are\ncomputationally expensive to generate, this behaviour can be can be\nchanged using the `return_exception_stacktraces` flag in\n`:start_clear_server` / `:start_tls_server` backwater options.\n\n##### Serialisation\n\nThe [external term format](http://erlang.org/doc/apps/erts/erl_ext_dist)\nis used for all function arguments and return values.\n\nBecause trust is assumed unless declared otherwise (like in regular\nErlang clusters), unsafe terms are decoded by default.\n\nFor function arguments, this behaviour can be tweaked through the\n`decode_unsafe_terms` setting in backwater options when running\n`:start_clear_server` or `:start_tls_server`.\n\nFor return values, this behaviour can be tweaked through the\n`decode_unsafe_terms` setting in `:call/5` options.\n\n##### Compression\n\nBy default, both serialised function arguments and serialised return\nvalues larger than 300 bytes are subject to attempted compression using\ngzip. The actual compression result is only used if it is indeed smaller\nthan the original payload.\n\nFor function arguments, this threshold can be tweaked through the\n`compression_threshold` setting in `:call/5` options.\n\nFor return values, this threshold can be tweaked through the\n`compression_threshold` setting in backwater options when running\n`:start_clear_server` or `:start_tls_server`.\n\n##### Payload limits\n\nBy default, both serialised function arguments and serialised return\nvalues larger than 8 MiB are rejected (independently of whether they're\ntransmitted in compressed form or not.)\n\nFor function arguments, this limit (in bytes) can be adjusted using the\n`max_encoded_args_size` setting in backwater options when running\n`:start_clear_server` or `:start_tls_server`.\n\nFor return values, this limit (in bytes) can be adjusted using the\n`max_encoded_result_size` setting in `:call/5` options.\n\n##### Timeouts and ports\n\nThe default listen port for HTTP is 8080; for HTTPS, it's 8443. This can\nbe adjusted on server using the `http` options, and on clients by\nspecifying it in `Endpoint`.\n\nThe client enforces a default connection timeout of 8s, and a receive\ntimeout of 5s. Either can be adjusted using either `connect_timeout` or\n`recv_timeout`, respectively, in `:call/5` options.\n\nThe server enforces a default receive timeout of 5s. This can be\nadjusted using the `recv_timeout` setting in backwater options, when\nrunning `:start_clear_server` or `:start_tls_server`.\n\n##### On using alternative HTTP clients\n\nFor now, the best way to achieve this is to build requests using the\n`backwater_request` module and interpret responses using the\n`backwater_response` module.\n\n#### License\n\nMIT License\n\nCopyright (c) 2017-2022 Guilherme Andrade\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-andrade%2Fbackwater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg-andrade%2Fbackwater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-andrade%2Fbackwater/lists"}