{"id":13615760,"url":"https://github.com/telanflow/mps","last_synced_at":"2025-05-13T05:31:22.229Z","repository":{"id":57539263,"uuid":"283937687","full_name":"telanflow/mps","owner":"telanflow","description":"MPS is a high-performance HTTP(S) proxy library that supports forward proxies, reverse proxies, man-in-the-middle proxies, tunnel proxies, Websocket proxies. MPS 是一个高性能HTTP(s)中间代理库，它支持正向代理、反向代理、中间人代理、隧道代理、Websocket代理","archived":false,"fork":false,"pushed_at":"2023-09-01T06:21:32.000Z","size":192,"stargazers_count":99,"open_issues_count":7,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T18:24:47.834Z","etag":null,"topics":["agent","forward","forward-proxy","go-proxy","goproxy","http-proxy","https-proxy","man-in-the-middle","middleware","mitm","mitmproxy","mps","proxies","proxy","proxy-server","reverse","reverse-proxy","socks5-proxy","tunnel-proxy","weksocket-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telanflow.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-31T03:58:43.000Z","updated_at":"2025-03-31T08:56:33.000Z","dependencies_parsed_at":"2024-06-18T21:23:58.759Z","dependency_job_id":null,"html_url":"https://github.com/telanflow/mps","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Fmps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Fmps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Fmps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telanflow%2Fmps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telanflow","download_url":"https://codeload.github.com/telanflow/mps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253882986,"owners_count":21978584,"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":["agent","forward","forward-proxy","go-proxy","goproxy","http-proxy","https-proxy","man-in-the-middle","middleware","mitm","mitmproxy","mps","proxies","proxy","proxy-server","reverse","reverse-proxy","socks5-proxy","tunnel-proxy","weksocket-proxy"],"created_at":"2024-08-01T20:01:17.532Z","updated_at":"2025-05-13T05:31:21.633Z","avatar_url":"https://github.com/telanflow.png","language":"Go","readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003eMPS\u003cbr\u003e\n\u003c/h1\u003e\n\nEnglish | [🇨🇳中文](README_ZH.md)\n\n## 📖 Introduction\n![MPS](https://github.com/telanflow/mps/workflows/MPS/badge.svg)\n![stars](https://img.shields.io/github/stars/telanflow/mps)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/telanflow/mps)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/telanflow/mps)\n[![license](https://img.shields.io/github/license/telanflow/mps)](https://github.com/telanflow/mps/LICENSE)\n\nMPS (middle-proxy-server) is an high-performance middle proxy library. support HTTP, HTTPS, Websocket, ForwardProxy, ReverseProxy, TunnelProxy, MitmProxy.\n\n## 🚀 Features\n- [X] Http Proxy\n- [X] Https Proxy\n- [X] Forward Proxy\n- [X] Reverse Proxy\n- [X] Tunnel Proxy\n- [X] Mitm Proxy (Man-in-the-middle) \n- [X] WekSocket Proxy\n\n## 🧰 Install\n```\ngo get -u github.com/telanflow/mps\n```\n\n## 🛠 How to use\nA simple proxy service\n\n```go\npackage main\n\nimport (\n    \"github.com/telanflow/mps\"\n    \"log\"\n    \"net/http\"\n)\n\nfunc main() {\n    proxy := mps.NewHttpProxy()\n    log.Fatal(http.ListenAndServe(\":8080\", proxy))\n}\n```\n\nMore [examples](https://github.com/telanflow/mps/tree/master/_examples)\n\n## 🧬 Middleware\nMiddleware can intercept requests and responses. \nwe have several middleware implementations built in, including [BasicAuth](https://github.com/telanflow/mps/tree/master/middleware)\n\n```go\nfunc main() {\n    proxy := mps.NewHttpProxy()\n    \n    proxy.Use(mps.MiddlewareFunc(func(req *http.Request, ctx *mps.Context) (*http.Response, error) {\n        log.Printf(\"[INFO] middleware -- %s %s\", req.Method, req.URL)\n        return ctx.Next(req)\n    }))\n    \n    proxy.UseFunc(func(req *http.Request, ctx *mps.Context) (*http.Response, error) {\n        log.Printf(\"[INFO] middleware -- %s %s\", req.Method, req.URL)\n        resp, err := ctx.Next(req)\n        if err != nil {\n            return nil, err\n        }\n        log.Printf(\"[INFO] resp -- %d\", resp.StatusCode)\n        return resp, err\n    })\n    \n    log.Fatal(http.ListenAndServe(\":8080\", proxy))\n}\n```\n\n## ♻️ Filters\nFilters can filter requests and responses for unified processing.\nIt is based on middleware implementation.\n\n```go\nfunc main() {\n    proxy := mps.NewHttpProxy()\n    \n    // request Filter Group\n    reqGroup := proxy.OnRequest(mps.FilterHostMatches(regexp.MustCompile(\"^.*$\")))\n    reqGroup.DoFunc(func(req *http.Request, ctx *mps.Context) (*http.Request, *http.Response) {\n        log.Printf(\"[INFO] req -- %s %s\", req.Method, req.URL)\n        return req, nil\n    })\n    \n    // response Filter Group\n    respGroup := proxy.OnResponse()\n    respGroup.DoFunc(func(resp *http.Response, err error, ctx *mps.Context) (*http.Response, error) {\n        if err != nil {\n            log.Printf(\"[ERRO] resp -- %s %v\", ctx.Request.Method, err)\n            return nil, err\n        }\n    \n        log.Printf(\"[INFO] resp -- %d\", resp.StatusCode)\n        return resp, err\n    })\n    \n    log.Fatal(http.ListenAndServe(\":8080\", proxy))\n}\n```\n\n## 📄 License\nSource code in `MPS` is available under the [BSD 3 License](/LICENSE).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelanflow%2Fmps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelanflow%2Fmps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelanflow%2Fmps/lists"}