{"id":31701775,"url":"https://github.com/getlantern/enproxy","last_synced_at":"2025-10-08T21:08:31.715Z","repository":{"id":17574751,"uuid":"20378186","full_name":"getlantern/enproxy","owner":"getlantern","description":"Chained HTTP proxy that supports arbitrary TCP traffic tunneled over HTTP proxies using encapsulated HTTP requests","archived":false,"fork":false,"pushed_at":"2018-09-13T19:17:38.000Z","size":244,"stargazers_count":49,"open_issues_count":2,"forks_count":9,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-10-29T09:02:48.729Z","etag":null,"topics":[],"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/getlantern.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":"2014-06-01T13:47:57.000Z","updated_at":"2024-04-16T00:33:55.000Z","dependencies_parsed_at":"2022-09-02T23:21:10.043Z","dependency_job_id":null,"html_url":"https://github.com/getlantern/enproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/getlantern/enproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fenproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fenproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fenproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fenproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getlantern","download_url":"https://codeload.github.com/getlantern/enproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fenproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000716,"owners_count":26082837,"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-08T02:00:06.501Z","response_time":56,"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":"2025-10-08T21:08:30.606Z","updated_at":"2025-10-08T21:08:31.707Z","avatar_url":"https://github.com/getlantern.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"enproxy [![Travis CI Status](https://travis-ci.org/getlantern/enproxy.svg?branch=master)](https://travis-ci.org/getlantern/enproxy)\u0026nbsp;[![Coverage Status](https://coveralls.io/repos/getlantern/enproxy/badge.png)](https://coveralls.io/r/getlantern/enproxy)\u0026nbsp;[![GoDoc](https://godoc.org/github.com/getlantern/enproxy?status.png)](http://godoc.org/github.com/getlantern/enproxy)\n==========\n\nenproxy provides an implementation of net.Conn that sends and receives data to/\nfrom a proxy using HTTP request/response pairs that encapsulate the data.  This\nis useful when you need to tunnel arbitrary protocols over an HTTP proxy that\ndoesn't support HTTP CONNECT.  Content distribution networks are one example of\nsuch a proxy.\n\nTo open such a connection:\n\n```go\nconn := \u0026enproxy.Conn{\n  Addr:   addr,\n  Config: \u0026enproxy.Config{\n    DialProxy: func(addr string) (net.Conn, error) {\n      // This opens a TCP connection to the proxy\n      return net.Dial(\"tcp\", proxyAddress)\n    },\n    NewRequest: func(method string, body io.Reader) (req *http.Request, err error) {\n      // This is called for every request from enproxy.Conn to the proxy\n      return http.NewRequest(method, \"http://\"+proxyAddress+\"/\", body)\n    },\n  },\n}\nerr := conn.Connect()\nif err == nil {\n  // start using conn as any other net.Conn\n}\n```\n\nTo start the corresponding proxy server:\n\n```go\nproxy := \u0026enproxy.Proxy{}\nerr := proxy.ListenAndServe(proxyAddress)\nif err != nil {\n  log.Fatalf(\"Unable to listen and serve: %s\", err)\n}\n```\n\n## Debugging\n\nenproxy allows tracing various global metrics about connections, which can be\nuseful when debugging issues like file descriptor leaks. To enable this tracing,\njust set the environment variable `TRACE_CONN_STATE=true`. This will cause the\nprogram to output information like the below every 5 seconds:\n\n```\n---- Enproxy Connections----\nOpen:                        34\nClosing:                      0\nBlocked on Closing:           0\nBlocked on Read:             33\nReading:                     33\nReading Finishing:            0\nBlocked on Write:             0\nWriting:                     33\n  Selecting:                 33\n  Writing:                    0\n    Write Pipe Open:          0\n    Request Pending:          0\n      Submitting Req.:        0\n      Processing Req.:        1\n        Posting Req. Fin:     0\n        Posting Resp:         0       \n        Dialing First:        0\n        Redialing:            0\n    Doing Write:              0\n  Posting Response:           0\n  Writing Empty:              0\n  Finishing Body:             0\n  Finishing:                  0\nRequesting:                  33\nRequesting Finishing:         0\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlantern%2Fenproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetlantern%2Fenproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlantern%2Fenproxy/lists"}