{"id":13825901,"url":"https://github.com/qgy18/pangolin","last_synced_at":"2025-07-08T22:32:38.133Z","repository":{"id":57318560,"uuid":"46657042","full_name":"qgy18/pangolin","owner":"qgy18","description":"A light weight http tunnels to localhost.","archived":false,"fork":false,"pushed_at":"2019-01-04T08:40:04.000Z","size":87,"stargazers_count":341,"open_issues_count":6,"forks_count":56,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-24T13:19:12.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/qgy18.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":"2015-11-22T11:09:27.000Z","updated_at":"2024-04-22T09:50:58.000Z","dependencies_parsed_at":"2022-08-25T22:42:01.704Z","dependency_job_id":null,"html_url":"https://github.com/qgy18/pangolin","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/qgy18%2Fpangolin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgy18%2Fpangolin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgy18%2Fpangolin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qgy18%2Fpangolin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qgy18","download_url":"https://codeload.github.com/qgy18/pangolin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470631,"owners_count":17479366,"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-08-04T09:01:28.873Z","updated_at":"2024-11-20T04:30:58.735Z","avatar_url":"https://github.com/qgy18.png","language":"JavaScript","funding_links":[],"categories":["\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"9d6789f22a280f5bb6491d1353b02384\"\u003e\u003c/a\u003e隧道\u0026\u0026穿透"],"readme":"[中文版](README_zh-CN.md)\n\n# Introduction\n\nPangolin, as it's name, is a simple reverse proxy that creates a secure tunnel from a public endpoint to a locally running web app. \n\nHTTP/1.1 requests are transmitted to local by HTTP/2 proxy.\n\n## Principle \n\n**Web browser** \u003c-------HTTP/1.1-------\u003e **Public endpoint** \u003c-------HTTP/2-------\u003e **Local server** \u003c-------HTTP/1.1-------\u003e **Local web app**\n\nWe can see that the public or other network's browsers can not  access the local network application directly. I open a TCP Server by running in the public network, let the network client to connected by socket, and then based on the connection in the network was created, a HTTP/2 Server can be used to forward each http requests.\n\nI created both HTTP/2 server and client based on [node-http2](https://github.com/molnarg/node-http2) while I make a little change to make it use a specified socket instance to create server and send requests.\n\nI use h2c (HTTP2 cleartext), so the transmit data from public to local are sent in the clear, the data format is binary because of HTTP/2. It is also quite easy to add TSL, but I didn't do it for a convenient testing.\n\n## Instructions\n\nInstall pangolin on both server and local side.\n\n```bash\nsudo npm install -g pangolin --verbose\n```\n\n### Command line\n\n* Server\n\n```bash\npangolin server -p 10000  #Start to listen，TCP port 10000\n```\n\n* Local\n\n```bash\npangolin client -r \u003cpublic ip/domain\u003e:\u003cport\u003e -l \u003cport\u003e\nor\npangolin client -r \u003cpublic ip/domain\u003e:\u003cport\u003e -l \u003clocal ip/domain\u003e:\u003cport\u003e\n```\n\n### Node.js API\n\n* Server\n\n```js\nvar pangolin = require('pangolin');\npangolin.createServer({\n  port: 10000,        //TCP port\n  httpConnects: 9     //Max http connections\n});\n```\n\n* Local\n\n```js\nvar pangolin = require('pangolin');\npangolin.connect({\n  remoteHost : '127.0.0.1',  //Server IP address\n  remotePort : 10000,        //Server TCP port\n  localHost  : '127.0.0.1',  //Local web app IP address\n  localPort  : 8360,         //Local web app port\n  showAccessLog : false      //Display logs or not   \n});\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqgy18%2Fpangolin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqgy18%2Fpangolin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqgy18%2Fpangolin/lists"}