{"id":15282526,"url":"https://github.com/knrt10/proxify","last_synced_at":"2025-05-07T03:45:23.994Z","repository":{"id":57705209,"uuid":"499685365","full_name":"knrt10/proxify","owner":"knrt10","description":"Simple raw TCP proxy with eBPF support","archived":false,"fork":false,"pushed_at":"2022-06-04T01:42:02.000Z","size":21,"stargazers_count":30,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T03:45:15.380Z","etag":null,"topics":["ebpf","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/knrt10.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":"2022-06-04T00:21:45.000Z","updated_at":"2024-12-30T11:45:42.000Z","dependencies_parsed_at":"2022-08-24T14:57:16.105Z","dependency_job_id":null,"html_url":"https://github.com/knrt10/proxify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knrt10%2Fproxify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knrt10%2Fproxify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knrt10%2Fproxify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knrt10%2Fproxify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knrt10","download_url":"https://codeload.github.com/knrt10/proxify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810273,"owners_count":21807759,"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":["ebpf","golang"],"created_at":"2024-09-30T14:26:43.121Z","updated_at":"2025-05-07T03:45:23.976Z","avatar_url":"https://github.com/knrt10.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/24803604/169649430-56ec4424-ff52-4559-933b-a6b105829861.png\" /\u003e\n\u003c/p\u003e\n\n\u003e Proxy your raw TCP requests\n\n\n# Contents\n\n- [Demo](#demo)\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Usage](#usage)\n- [Running the code](#running-the-code)\n- [Internals](#internals)\n- [eBPF](#ebpf)\n    - [Testing](#testing)\n- [TODO](#todo)\n- [Inspiration](#inspiration)\n\n## Demo\n[![Demo](https://asciinema.org/a/499416.svg)](https://asciinema.org/a/499416?autoplay=1)\n\n## Features\n\n- `proxify` is a simple tool, which routes connection on specific port to given targets.\n- It supports `eBPF steering` which routes connections on any configured port to proxifies's listener port.\n\n## Prerequisites\n\nYou'll need a Linux host running kernel \u003e= 5.9 (when they introduced sk_lookup) to build and run your BPF program. Linux in Docker on an M1 Mac will _not_ work. If you don't have access to a Linux box and can't run a VM you can spin up a dev VM.\n\nYou'll need the following tools and libraries installed:\n  - `bpftool` compiled for a \u003e= 5.9 kernel, because pre-5.9 `bpftool` doesn't know what an sk_lookup program is.\n  - `libbpf` source code, which you can get from Github, because it has a recent `bpf_helper_defs.h` with `bpf_sk_assign` in it, which you need to make this program work.\n  - clang\u003e10 to generate ELF .o's that new bpftool will load from.\n\n- [go-bindata](https://github.com/go-bindata/go-bindata/): Install using `go install -a -v github.com/go-bindata/go-bindata/...@latest`\n\n## Usage\n\n```\n➜  ./proxify --help\nUsage of ./proxify:\n  -b\tenable bpf steering\n  -p int\n    \tlistener port for bpf steering (default 8080)\n```\n\n## Running the code\n\n```bash\n# Build the proxify binary\nmake proxify\n\n# To run in normal mode. Open up terminal and run the following command\n./proxify\n\n# To run in eBPF steering mode. Open up terminal and run the following.\nsudo ./proxify -b\n\n# On a different termial, run the following command\necho \"hello there general kenobi\" | nc -N -4 localhost 5001\n```\n\n## Internals\n\nSee [docs/architecture](docs/architecture.md)\n\n## eBPF\n\n### Testing\n\n```bash\n# Run in eBPF steering mode. Open up terminal and run the following.\nsudo ./proxify -b\n\n# On a different termial, run the following command\necho \"hello there general kenobi\" | nc -N -4 localhost 5001\n\n# Check bpfmaps\nsudo bpftool map\n\n# Dump map data from id\nsudo bptfool map dump id \u003cid_number\u003e\n\n# Update new data to proxy_ports map. This adds port 7 to it.\nsudo bpftool map update id \u003cid_number\u003e key 0x07 0x00 value 0x00\n\n# Test the connection, it should work\necho \"hello there general kenobi\" | nc -N -4 localhost 7\n\n# Check link\nsudo bpftool link\n```\n\n## TODO\n- [ ] Add tests\n- [ ] Add github actions\n- [ ] Update bpf maps on reload\n- [ ] Add monitoring\n- [ ] Add structured logging\n- [ ] Background Health checks for unhealthy targets. \n- [ ] Filter requests from the start from unverified sources.\n- [ ] Encryption/decryption support for requests.\n- [ ] Caching support.\n- [ ] Support batch request instead of just single request.\n- [ ] Add security by adding authentication for client requests using certificates.\n\n## Inspiration\n\n[eBPF summit 2020](https://ebpf.io/summit-2020-slides/eBPF_Summit_2020-Lightning-Jakub_Sitnicki-Steering_connections_to_sockets_with_BPF_socke_lookup_hook.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknrt10%2Fproxify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknrt10%2Fproxify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknrt10%2Fproxify/lists"}