{"id":18842188,"url":"https://github.com/lutfailham96/go-http-injector","last_synced_at":"2026-02-09T11:03:07.924Z","repository":{"id":61624284,"uuid":"538344746","full_name":"lutfailham96/go-http-injector","owner":"lutfailham96","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-21T08:30:15.000Z","size":55,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T21:12:38.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/lutfailham96.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-09-19T05:20:42.000Z","updated_at":"2022-11-27T07:26:08.000Z","dependencies_parsed_at":"2022-10-19T18:45:28.332Z","dependency_job_id":null,"html_url":"https://github.com/lutfailham96/go-http-injector","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/lutfailham96%2Fgo-http-injector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutfailham96%2Fgo-http-injector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutfailham96%2Fgo-http-injector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lutfailham96%2Fgo-http-injector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lutfailham96","download_url":"https://codeload.github.com/lutfailham96/go-http-injector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248839398,"owners_count":21169809,"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-11-08T02:53:59.342Z","updated_at":"2026-02-09T11:03:07.866Z","avatar_url":"https://github.com/lutfailham96.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tcp-proxy\n[![go-tcp-proxy CI](https://github.com/lutfailham96/go-http-injector/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/lutfailham96/go-http-injector/actions/workflows/ci.yml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/b458531c1805fb033210/maintainability)](https://codeclimate.com/github/lutfailham96/go-http-injector/maintainability)\n\nA small TCP proxy written in Go\n\nThis project was intended for debugging text-based protocols. The next version will address binary protocols.\n\n## Install\n\n**Source**\n\n``` sh\n$ go get -v github.com/lutfailham96/go-http-injector/cmd/tcp-proxy\n```\n\n## Usage\n\n```\n$ tcp-proxy --help\nUsage of tcp-proxy:\n  -c: output ansi colors\n  -h: output hex\n  -l=\"localhost:9999\": local address\n  -n: disable nagles algorithm\n  -r=\"localhost:80\": remote address\n  -s=\"server address / sni address\": server:443\n  -rp=\"use as reverse proxy\"\n  -in-payload=\"payload to be used as incoming TCP packet\"\n  -out-payload=\"payload to be used as outbound TCP packet\"\n  -v: display server actions\n  -vv: display server actions and all tcp data\n```\n\n*Note: Regex match and replace*\n**only works on text strings**\n*and does NOT work across packet boundaries*\n\n### Client Example\n\nUse custom payload\n```shell\n$ go run cmd/tcp-proxy/main.go \\\n    -l 127.0.0.1:9999 \\\n    -r 127.0.0.1:10443 \\\n    -s myserver:443 \\\n    -out-payload=\"GET ws://cloudflare.com HTTP/1.1[crlf]Host: [host][crlf]Upgrade: websocket[crlf]Connection: keep-alive[crlf][crlf]\"\n\nProxying from 127.0.0.1:9999 to 104.15.50.1:443\n```\n\nstunnel configuration\n```\n[ws]\nclient = yes\naccept = 127.0.0.1:10443\nconnect = 104.15.50.5:443\nsni = cloudflare.com\ncert = /etc/stunnel/ssl/stunnel.pem\n\n```\n\nTunnel over SSH conneciton\n```shell\n$ ssh -o \"ProxyCommand=corkscrew 127.0.0.1 9999 %h %p\" -v4ND 1080 my-user@localhost\n```\n\n### Todo\n\n* Implement `tcpproxy.Conn` which provides accounting and hooks into the underlying `net.Conn`\n* Verify wire protocols by providing `encoding.BinaryUnmarshaler` to a `tcpproxy.Conn`\n* Modify wire protocols by also providing a map function\n* Implement [SOCKS v5](https://www.ietf.org/rfc/rfc1928.txt) to allow for user-decided remote addresses\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flutfailham96%2Fgo-http-injector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flutfailham96%2Fgo-http-injector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flutfailham96%2Fgo-http-injector/lists"}