{"id":16677292,"url":"https://github.com/kernelerr/fourth","last_synced_at":"2025-03-21T18:31:57.765Z","repository":{"id":57631625,"uuid":"419644558","full_name":"KernelErr/fourth","owner":"KernelErr","description":"Simple and fast layer 4 proxy in Rust","archived":false,"fork":false,"pushed_at":"2021-12-30T14:09:53.000Z","size":83,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-13T00:42:27.774Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KernelErr.png","metadata":{"files":{"readme":"README-EN.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":"2021-10-21T08:38:08.000Z","updated_at":"2023-06-06T18:41:36.000Z","dependencies_parsed_at":"2022-09-04T22:34:01.939Z","dependency_job_id":null,"html_url":"https://github.com/KernelErr/fourth","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelErr%2Ffourth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelErr%2Ffourth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelErr%2Ffourth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KernelErr%2Ffourth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KernelErr","download_url":"https://codeload.github.com/KernelErr/fourth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221817505,"owners_count":16885554,"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","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-12T13:25:55.214Z","updated_at":"2024-10-28T10:34:47.265Z","avatar_url":"https://github.com/KernelErr.png","language":"Rust","readme":"# Fourth\n\n\u003e Hey, now we are on level 4!\n\n[![](https://img.shields.io/crates/v/fourth)](https://crates.io/crates/fourth) [![CI](https://img.shields.io/github/workflow/status/kernelerr/fourth/Rust)](https://github.com/KernelErr/fourth/actions/workflows/rust.yml)\n\n**Under heavy development, version 0.1 may update frequently**\n\nFourth is a layer 4 proxy implemented by Rust to listen on specific ports and transfer TCP/KCP data to remote addresses(only TCP) according to configuration.\n\n## Features\n\n- Listen on specific port and proxy to local or remote port\n- SNI-based rule without terminating TLS connection\n- Allow KCP inbound(warning: untested)\n\n## Installation\n\nTo gain best performance on your computer's architecture, please consider build the source code. First, you may need [Rust tool chain](https://rustup.rs/).\n\n```bash\n$ cd fourth\n$ cargo build --release\n```\n\nBinary file will be generated at `target/release/fourth`, or you can use `cargo install --path .` to install.\n\nOr you can use Cargo to install Fourth:\n\n```bash\n$ cargo install fourth\n```\n\nOr you can download binary file form the Release page.\n\n## Configuration\n\nFourth will read yaml format configuration file from `/etc/fourth/config.yaml`, and you can set custom path to environment variable `FOURTH_CONFIG`, here is an minimal viable example:\n\n```yaml\nversion: 1\nlog: info\n\nservers:\n  proxy_server:\n    listen:\n      - \"127.0.0.1:8081\"\n    default: remote\n\nupstream:\n  remote: \"tcp://www.remote.example.com:8082\" # proxy to remote address\n```\n\nBuilt-in two upstreams: ban(terminate connection immediately), echo. For detailed configuration, check [this example](./example-config.yaml).\n\n## Performance Benchmark\n\nTested on 4C2G server:\n\nUse fourth to proxy to Nginx(QPS of direct connection: ~120000): ~70000 req/s (Command: `wrk -t200 -c1000 -d120s --latency http://proxy-server:8081`)\n\nUse fourth to proxy to local iperf3: 8Gbps\n\n## Thanks\n\n- [tokio_kcp](https://github.com/Matrix-Zhang/tokio_kcp)\n\n## License\n\nFourth is available under terms of Apache-2.0.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernelerr%2Ffourth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkernelerr%2Ffourth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkernelerr%2Ffourth/lists"}