{"id":16934371,"url":"https://github.com/codeskyblue/proxylocal","last_synced_at":"2025-04-11T18:51:54.982Z","repository":{"id":57706066,"uuid":"41543556","full_name":"codeskyblue/proxylocal","owner":"codeskyblue","description":"Proxy local server to public network. (include server and client)","archived":false,"fork":false,"pushed_at":"2016-11-10T07:03:32.000Z","size":252,"stargazers_count":15,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:44:48.505Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeskyblue.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-08-28T11:21:05.000Z","updated_at":"2021-06-15T00:10:33.000Z","dependencies_parsed_at":"2022-08-24T14:57:17.108Z","dependency_job_id":null,"html_url":"https://github.com/codeskyblue/proxylocal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeskyblue%2Fproxylocal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeskyblue%2Fproxylocal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeskyblue%2Fproxylocal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeskyblue%2Fproxylocal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeskyblue","download_url":"https://codeload.github.com/codeskyblue/proxylocal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248464317,"owners_count":21108238,"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-13T20:51:55.679Z","updated_at":"2025-04-11T18:51:54.951Z","avatar_url":"https://github.com/codeskyblue.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# proxylocal\n[![Build Status](https://travis-ci.org/codeskyblue/proxylocal.svg?branch=master)](https://travis-ci.org/codeskyblue/proxylocal)\n[![GoDoc](https://godoc.org/github.com/codeskyblue/proxylocal/pxlocal?status.svg)](https://godoc.org/github.com/codeskyblue/proxylocal/pxlocal)\n\nProxy local service to public.\n\n\u003e I want to expose a local server behide a NAT or firewall to the internet.\n\nThere are some similar service.\n\n* \u003chttp://localtunnel.me/\u003e Write in nodejs. Very good one.\n* \u003chttps://pagekite.net/\u003e Write in python.\n* \u003chttps://ngrok.com/\u003e Blocked by GFW.\n* \u003chttps://forwardhq.com/\u003e Need pay price to get service.\n* \u003chttp://www.tunnel.mobi/\u003e Server seems down. Use ngrok, VPS in china.\n\nBinary can be download from [gorelease](http://gorelease.herokuapp.com/codeskyblue/proxylocal)\n\nVery suggest to compile use `go1.4`. I donot know why, but use `go1.5`, the proxylocal got a very very bad performance.\n\nAt the beginning this is just for study how to proxy local server to public network. Now it can be stable use.\n\n这个东西目前看来确实是个很不错的东西，可以调试微信，可以把自家路由器的东西放到外网。还可以通过它的tcp转发功能，远程调试家中的树莓派。用途多多\n\n不过服务器最好自己搭. 如果希望贡献出来你的server可以发起个Issue.\n\n## Installation\n```\ngo get -v github.com/codeskyblue/proxylocal\n```\n\n## Usage\nRun server in a public network, listen in port 8080 (Assuming your ip is 122.2.2.1)\n\n\tproxylocal --listen 8080\n\nAssume you are running your local tcp-server on port 5037. To make it publicly available run:\n\n\tproxylocal --server 122.2.2.1:8080 --proto tcp 5037\n\nIf this is a web server, only need to update `--proto`\n\t\n\tproxylocal --server 122.2.2.1:8080 --proto http 5037\n\n\t# expects output\n\tproxy URL: http://localhost:5037\n\tRecv Message: Local server is now publicly available via:\n\thttp://wn8yn.t.localhost\n\n## Hooks\nThe functions of hooks are limited.\n\nThe hook system is very familar with git hook. When a new proxy request comes to the server. Server will execute some script.\n\nNow I put all the hook script in hooks dir. \n\nThere are examples you found in [hooks](hooks)\n\n## Use as a library\n```go\npackage main\n\nimport \"github.com/codeskyblue/proxylocal/pxlocal\"\n\nfunc main(){\n\tclient := pxlocal.NewClient(\"10.0.1.1:4000\")\n\tpx, err := client.StartProxy(pxlocal.ProxyOptions{\n\t\tProto:      pxlocal.TCP,\n\t\tLocalAddr:  \"192.168.0.1:7000\",\n\t\tListenPort: 40000, // public port\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// px.RemoteAddr()\n\terr = px.Wait()\n\tlog.Fatal(err)\n}\n```\n### Environment\nServer address default from env-var `PXL_SERVER_ADDR`\n\n## LICENSE\n[MIT LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeskyblue%2Fproxylocal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeskyblue%2Fproxylocal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeskyblue%2Fproxylocal/lists"}