{"id":16889852,"url":"https://github.com/benoitc/sieve","last_synced_at":"2025-10-11T11:45:23.769Z","repository":{"id":66247198,"uuid":"11266545","full_name":"benoitc/sieve","owner":"benoitc","description":"sieve is a simple TCP routing proxy (layer 7) in erlang","archived":false,"fork":false,"pushed_at":"2015-07-03T07:50:22.000Z","size":92,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-08T00:38:17.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-08T21:58:42.000Z","updated_at":"2023-11-10T06:56:27.000Z","dependencies_parsed_at":"2023-02-20T02:35:22.336Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/sieve","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benoitc/sieve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fsieve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fsieve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fsieve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fsieve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/sieve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Fsieve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007063,"owners_count":26084230,"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-10-11T02:00:06.511Z","response_time":55,"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":[],"created_at":"2024-10-13T16:59:22.353Z","updated_at":"2025-10-11T11:45:23.753Z","avatar_url":"https://github.com/benoitc.png","language":"Erlang","readme":"# sieve\n\nsieve is a simple TCP routing proxy (layer 7) in erlang and using\n[barrel](http://github.com/benoitc/barrel) connection handling. It lets\nyou configure the routine logic in Erlang.\n\nIf you need to proxy connections to different backend servers depending\non the contents of the transmission, then sieve will helps\nyou. It's heavily inspidered from [proxymachine](https://github.com/mojombo/proxymachine).\n\n\n## Build\n\nYou need [rebar](http://github.com/rebar/rebar) to build\ncowboy_revproxy:\n\n    $ rebar get-deps\n    $ rebar compile\n\n## Usage\n\nThe idea is simple, once a request is coming to the proxy the data is\npassed to a proxy function until this function return a remote\nconnection or tell to the proxy to close the connection.\n\n**Valid returns values** are :\n\n* `continue` or `ok` -\u003e wait for next chunk\n* `stop` -\u003e close the connection\n* `{stop, Reply}` -\u003e send Reply to the client and close the connection\n* `{remote, Remote}` -\u003e return the address of the remote connection to\n  proxy. Remote can be one of the following:\n    - `{ip, port}`\n    - `{ssl, Ip, Port, Options}`, where options are ssl options\n      (keyfile, certfile \u0026 password).\n* `[{remote, Remote}, {data, Data}]` -\u003e same as above, but data passed to\n  the proxy function is replaced by `Data` and will be send to the remote\n  connection.\n* `[{remote, Remote}, {data, Data}, {reply, Reply}]` -\u003e same as above\n  but reply `Reply` to the client.\n\n## Example\n\nHere is a simple example of function proxying the port 8080 to google.com:\n\n    -module(cowboy_revproxy_example).\n    -export([start/0, proxy/1]).\n\n    proxy(_Data) -\u003e\n        {remote, {\"openbsd.org\", 80}}.\n\n    start() -\u003e\n        barrel:start(),\n        application:start(lager),\n        barrel:start_listener(http, 100, barrel_tcp, [{port, 8080}],\n                              sieve_revproxy, [{proxy, {?MODULE, proxy}}]).\n\nTo test it do, in the source folder:\n\n    $ rebar get-deps compile\n    $ erl -pa ebin -pa deps/barrel/ebin\n\nThen in the erlang shell:\n\n    1\u003e sieve_example:start().\n\nand go on http://127.0.0.1:8080/ , it should display the\n[OpenBSD](http://openbsd.org) website.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fsieve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Fsieve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Fsieve/lists"}