{"id":13723756,"url":"https://github.com/paultag/sniff","last_synced_at":"2025-04-07T08:26:49.218Z","repository":{"id":57479876,"uuid":"48627886","full_name":"paultag/sniff","owner":"paultag","description":"Dispatch TLS Connections based on SNI","archived":false,"fork":false,"pushed_at":"2020-02-07T00:52:15.000Z","size":21,"stargazers_count":58,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T07:05:09.039Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paultag.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-12-27T00:32:59.000Z","updated_at":"2024-07-02T21:49:31.000Z","dependencies_parsed_at":"2022-09-26T17:41:33.012Z","dependency_job_id":null,"html_url":"https://github.com/paultag/sniff","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/paultag%2Fsniff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paultag%2Fsniff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paultag%2Fsniff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paultag%2Fsniff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paultag","download_url":"https://codeload.github.com/paultag/sniff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247617603,"owners_count":20967638,"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-03T01:01:45.255Z","updated_at":"2025-04-07T08:26:49.198Z","avatar_url":"https://github.com/paultag.png","language":"Go","funding_links":[],"categories":["Go","others","\u003ca id=\"7bf0f5839fb2827fdc1b93ae6ac7f53d\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"32739127f0c38d61b14448c66a797098\"\u003e\u003c/a\u003e嗅探\u0026\u0026Sniff"],"readme":"sniff\n=====\n\nSNIff is a small server that will accept incoming TLS connections, and parse\nTLS Client Hello messages for the SNI Extension. If one is found, we'll go\nahead and forward that connection to a remote (or local!) host.\n\nsniff config\n------------\n\n```json\n{\n    \"bind\": {\n        \"host\": \"localhost\",\n        \"port\": 8443\n    },\n    \"servers\": [\n        {\n            \"default\": false,\n            \"regexp\": false,\n            \"host\": \"97.107.130.79\",\n            \"names\": [\n                \"pault.ag\",\n                \"www.pault.ag\"\n            ],\n            \"port\": 443\n        }\n    ]\n}\n```\n\nThe following config will listen on port `8443`, and connect any requests\nto `pault.ag` or `www.pault.ag` to port `443` on host `97.107.130.79`. If\nnothing matches this, the socket will be closed.\n\nChanging default to true would send any unmatched hosts (or TLS / SSL connections\nwithout SNI) to that host.\n\nBy default, the requested domain name is compared literally with the strings\ninside `names`. If `regexp` is true, then the names are interpreted as regular\nexpressions. Each server and name will be checked in the order they appear in\nthe file, stopping with the first match. If there is no match, then the\nrequest is sent to the first server with `default` set.\n\nusing the parser\n----------------\n\n```\nimport (\n    \"fmt\"\n\n    \"pault.ag/go/sniff/parser\"\n)\n\nfunc main() {\n    listener, err := net.Listen(\"tcp\", \"localhost:2222\")\n    if err != nil {\n        return err\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaultag%2Fsniff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaultag%2Fsniff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaultag%2Fsniff/lists"}