{"id":16878080,"url":"https://github.com/rinsuki/sniproxy","last_synced_at":"2025-10-08T08:48:30.638Z","repository":{"id":92796596,"uuid":"266207630","full_name":"rinsuki/sniproxy","owner":"rinsuki","description":"接続されたクライアントの SNI のホスト名によって接続先を振り分けるproxy","archived":false,"fork":false,"pushed_at":"2021-12-07T09:51:55.000Z","size":22,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T14:47:15.054Z","etag":null,"topics":["deno"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rinsuki.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,"zenodo":null}},"created_at":"2020-05-22T21:07:16.000Z","updated_at":"2022-05-23T06:49:44.000Z","dependencies_parsed_at":"2023-08-22T23:01:41.519Z","dependency_job_id":null,"html_url":"https://github.com/rinsuki/sniproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rinsuki/sniproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinsuki%2Fsniproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinsuki%2Fsniproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinsuki%2Fsniproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinsuki%2Fsniproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rinsuki","download_url":"https://codeload.github.com/rinsuki/sniproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinsuki%2Fsniproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278916439,"owners_count":26068090,"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":["deno"],"created_at":"2024-10-13T15:46:32.625Z","updated_at":"2025-10-08T08:48:30.631Z","avatar_url":"https://github.com/rinsuki.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sniproxy\n\ntcp/443 として listen し、接続されたクライアントの SNI のホスト名によって実際の接続先を振り分けます。\nconfig に http_port を指定すると HTTP の Host ヘッダーでも振り分けてくれるサーバーが追加で listen するようになります。\n\n## Requirements\n\n- Deno\n\n## サポートされている接続先\n\n- `disconnect` (接続切断、デフォルト)\n- `direct` (そのまま繋ぐ)\n- `redirect://host:port` (指定されたホストとポートに接続)\n- `http://host:port` (指定されたHTTPプロキシを経由して接続)\n\n### 今後対応予定\n\n- `socks5://host:port` (指定されたSOCKS5プロキシを経由して接続)\n\n## config\n\n環境変数 `SNIPROXY_CONFIG_FILE` があればそのパスを、なければ `$(pwd)/sniproxy.yml` を参照します。\nconfigファイルはyamlです。\n\n### configファイルの文法\n\n```yaml\nhttp_port: 80 # http_port を指定すると HTTP で待ち受けて SNI のホスト名の代わりに Host ヘッダーで割り振るサーバーが追加でlistenするようになります\nmap:\n  - to: http://proxy:8080 # 前述の接続先の文法\n    from:\n      - \"api.example\"\n  - to: redirect://localhost:4443\n    from:\n      - \"server.internal\"\n  - to: direct\n    from:\n      - \"**.example.com\"\n```\n\n`from` でのホスト名は(たぶん)globっぽいパターンに対応しています。詳しくは [src/utils/wildcard-to-regex.ts](./src/utils/wildcard-to-regex.ts) を参照してください。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinsuki%2Fsniproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frinsuki%2Fsniproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinsuki%2Fsniproxy/lists"}